7

How to enable H264 on Android WebRTC.
PeerConnection to createOffer there was no h264 description in SDP.

GianhTran
  • 3,443
  • 2
  • 22
  • 42
fldy
  • 205
  • 3
  • 7

3 Answers3

2

Google's current WebRTC implementation only supports hardware H.264 decoding and encoding on Android, and with select chipsets only. So if a particular device doesn't have hardware H.264 support or has an unsupported chipset, you'll only get VP8/VP9.

jamix
  • 5,484
  • 5
  • 26
  • 35
2

Google blocks their own software codecs by default, for some reason, so if you don't have hardware decoding in your chipset (or if you use an emulator), you will get no h264 codecs when webrtc checks for them.

If you go into the webrtc code and remove "OMX.google" from https://chromium.googlesource.com/external/webrtc/+/HEAD/sdk/android/src/java/org/webrtc/MediaCodecUtils.java#33 then create a custom build of webrtc for android based off that code, the software encoder will be unblocked.

Paul Oliva
  • 139
  • 1
  • 5
  • Hey there paul i am using your aar file but still my app is throwing the following error can u help me find the root cause ? E/ACodec: [OMX.MTK.VIDEO.DECODER.VPX] ERROR(0x80001005) E/ACodec: signalError(omxError 0x80001005, internalError -2147483648) E/MediaCodec: Codec reported err 0x80001005, actionCode 0, while in state 6 E/org.webrtc.Logging: AndroidVideoDecoder: deliverDecodedFrame failed – Aashit Shah Jan 07 '21 at 10:50
  • Sure, what type of video are you trying to play? What type of device are you using?My guy instinct here is that `OMX.MTK.VIDEO.DECODER.VPX` tells us it's a VPX encoded video, not h264? – Paul Oliva Jan 08 '21 at 14:13
0

H.264 works with WebRTC in Chrome on Android M57.

Peter G.
  • 106
  • 7