[英]Why WebRTC only support H264 in Chrome but not in native application with some devices
I use official sample to create offer SDP in Android Chrome, we can find a=rtpmap:100 H264/90000
that meant it can support H264. 我使用官方示例在Android Chrome中创建商品SDP,我们可以找到a=rtpmap:100 H264/90000
,这意味着它可以支持H264。
But if I build AppRTC(official Android sample) and use official prebuilt libraries version 1.0.25821, call createOffer then receive SDP in SdpObserver::onCreateSuccess
, the SDP did not contain H264. 但是,如果我构建AppRTC(Android官方示例)并使用官方预构建库版本1.0.25821,请调用createOffer,然后在SdpObserver::onCreateSuccess
接收SDP,则SDP 不包含H264。
My test device is Oppo R15 (with MTK Helio P60, Android 8.1). 我的测试设备是Oppo R15(带有MTK Helio P60,Android 8.1)。
So, why WebRTC only support H264 in Chrome but not in native application with some Android devices? 那么,为什么WebRTC仅在Chrome中支持H264,而在某些Android设备上不支持本机应用程序?
Chrome build uses openh264 which is not used by regular **WebRTC . Chrome版本使用openh264,而常规** WebRTC则不使用 。 What I meant by regular is that there is variant with software h.264 encoder from the chrome build which you may use but I wouldn't recommend it. 我通常所说的是,您可能会使用chrome版本的h.264编码器软件,但我不建议这样做。
On Android WebRTC , H.264 is supported only if 在Android WebRTC上 ,仅在以下情况下支持H.264
At Java level, you can see that in HardwareVideoEncoderFactory.java
which checks for QCOM and EXYNOS devices in isHardwareSupportedInCurrentSdkH264
function. 在Java级别,您可以在HardwareVideoEncoderFactory.java
中看到该代码,它在isHardwareSupportedInCurrentSdkH264
函数中检查QCOM和EXYNOS设备。
Interestingly, if you are using native code, even QCOM and EXYNOS hardware encoders are not supported (there is bug filed on Webrtc issue tracker). 有趣的是,如果您使用的是本机代码,则甚至不支持QCOM和EXYNOS硬件编码器(Webrtc问题跟踪器中已记录了错误)。 This is because of tight integration of HW encoding code with JNI code - definitely not a good modular code. 这是由于HW编码代码与JNI代码的紧密集成-绝对不是一个好的模块化代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.