【问题标题】:Android WebRTC supported codecAndroid WebRTC 支持的编解码器
【发布时间】:2019-09-26 00:59:42
【问题描述】:

我刚刚在谷歌上读到一个帖子,荣耀和华为在使用 webrtc 时无法编码为 H264: https://groups.google.com/forum/#!searchin/discuss-webrtc/huawei$20h264%7Csort:date/discuss-webrtc/EA14U8FMT_k/Jn3CEG7YCQAJ

这是真的吗??? 这看起来很奇怪,我们不能这样做......

另外,我读了那个帖子是因为,我用三星而不是华为 P20 来编码我的流。 (使用华为创建的流保持 PV8 而不是我测试的其他 H.264 设备)

这是向不支持购买华为和荣耀的人证明的 WebRTC 中的代码:

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()]);
 }

如果需要,我可以添加一段代码。 感谢阅读。

【问题讨论】:

标签: android webrtc h.264


【解决方案1】:

是的,它很糟糕,如果你查看源代码here(函数 isHardwareSupportedInCurrentSdkH264())没有提到海思,只是高通 exynos。

我已经看到人们在这个issue 中解决了这个问题,只是在提议中强制使用 sdp,但它对我不起作用。

【讨论】:

  • 好的,谢谢回复我。你知道我如果我们在webrtc代码中添加(在函数isHardwareSupportedInCurrentSdkH264)hisilicon限制,如果它工作?
  • 我也会尝试强制sdp
  • 你知道他们是否会尽快修复这个错误,就像他们在上面一样,或者他们无关紧要
【解决方案2】:

我不知道它是否会被修复,我认为不会...... 您可以切换到 vp8 编解码器,它具有 sw 编码/解码回退,并且适用于华为设备。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-04
    • 2021-05-19
    相关资源
    最近更新 更多