0

Trying to get WebRTC to work on an Andoid device using GeckoView. I need AV1 and/or H264 codecs, however, on the webpage calling:

new RTCPeerConnection().createOffer({offerToReceiveVideo: true}).then(s => console.log(s.sdp))

Only shows the VP8 and VP9 codecs.

The same code in the chromium webview does produce the AV1 and H264 codecs.

What do I have to do to get H264/AV1 codecs in GeckoView?

Note, testing the same code on the official firefox app produces the same results (no H264/AV1 codecs).

Using Android 12 and GeckoView 107.0.20221110173214

Example: https://mozilla.github.io/webrtc-landing/pc_test_no_h264.html Open this page in the FireFox official app or Gecko webivew. They both show h264 not supported.

alexward1230
  • 579
  • 3
  • 8
  • 25
  • Related: https://bugzilla.mozilla.org/show_bug.cgi?id=1548679 – Morrison Chang Nov 18 '22 at 00:11
  • Hmm that seems to indicate that it was intentionally removed? The odd thing is, I tested on a few devices some don't (pixel 6) while others do. So it must be device-specific, however, the device that doesn't have h264 support in firefox/geckoview does support the codec (normal webview, chrome, etc has it). I wonder what is making firefox omit the h264 codec on _some_ devices... – alexward1230 Nov 18 '22 at 07:31
  • If your devices are old enough, the thread is from middle of 2019, they may have the h264 plugin installed before its removal from Firefox. A wipe/reinstall would be the way to check. Basically this boils down to a licensing / store policy issue. As [Android Compatibility Definition Document](https://source.android.com/docs/compatibility/13/android-13-cdd) requires h.264 encode/decode - manufacturers pay for the license. As mentioned in the link, Firefox didn't want the latency for using the system h.264 encoder. – Morrison Chang Nov 18 '22 at 07:47
  • What's confusing to me is that I am using the same geckoview version ` implementation "org.mozilla.geckoview:geckoview:107.0.20221110173214"` in my app. But on some devices h264 video plays while on others it doesn't. If I'm using the same GV version shouldn't it always have an h264 decoder? I'm not sure if its using HW or SW decoder on the devices that its working, but they are all devices that should support h264 hw acceleration – alexward1230 Nov 19 '22 at 10:14
  • At this point I would list your devices/Android OS along with what the plugin status/test page states: https://support.mozilla.org/en-US/kb/firefox-android-openh264 I'm wondering if the GeckoView is using the Firefox installed plugin. – Morrison Chang Nov 19 '22 at 19:51
  • Google Pixel 6 - Android 12: Test site says h264 is not supported. Galaxy A32 - Andorid 11: Test site says h264 is supported. LG G8 - Andorid 10: Test site says h264 is supported. All phones running geckoview 107 and latest firefox app from the paly store (showing the same results). – alexward1230 Nov 21 '22 at 09:12

0 Answers0