Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable H264 on Android webRTC

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

like image 275
fldy Avatar asked Apr 21 '16 10:04

fldy


2 Answers

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.

like image 73
jamix Avatar answered Nov 19 '22 11:11

jamix


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.

like image 24
Paul Oliva Avatar answered Nov 19 '22 11:11

Paul Oliva