我刚刚在谷歌上读到一个线程,Honor 和华为在使用 webrtc 时无法编码为 H264:https : //groups.google.com/forum/#!searchin/discuss-webrtc/huawei $20h264%7Csort:日期/讨论-webrtc/EA14U8FMT_k/Jn3CEG7YCQAJ
真的吗 ???这看起来真的很奇怪,我们不能那样做......
另外,我阅读了该线程,因为我使用三星而不是华为 P20 对我的流进行编码。(使用华为创建的流保持 PV8 而不是我测试的其他设备是 H.264)
这是WebRTC中的代码,向不支持购买华为和Honor的人证明:
final ArrayList<MediaCodecProperties> supported_codecs = new ArrayList<MediaCodecProperties>();
supported_codecs.add(qcomH264HwProperties);
supported_codecs.add(exynosH264HwProperties);
if (PeerConnectionFactory.fieldTrialsFindFullName("WebRTC-MediaTekH264").equals("Enabled")) {
supported_codecs.add(mediatekH264HwProperties);
}
return supported_codecs.toArray(new MediaCodecProperties[supported_codecs.size()]);
}
如果需要,我可以添加我的一段代码。谢谢阅读。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句