Android/iOS WebRTC H264 and packetization-mode=0

277 views
Skip to first unread message

Sean Horton

unread,
Jan 4, 2024, 4:50:30 AM1/4/24
to discuss-webrtc
Hi,

Is there a known way to get H264 support on Android and iOS with `packetization-mode=0`? From what I've seen, mobile only supports `packetization-mode=1`.

If H264 and packetization-mode=0 is not supported on mobile, would it be something feasible for myself to add through VideoEncoder(Decoder)Factory? Are there any known guides or thoughts on how to go about this?

Thanks. 


Sean Horton

unread,
Jan 5, 2024, 6:42:59 AM1/5/24
to discuss-webrtc
I'm not sure how safe the following is, but I was able to get both an h264 decoder and encoder with packetization-mode=0 working by;

1. Override `getSupportedCodecs()` on both `DefaultVideoEncoderFactory` and `DefaultVideoDecoderFactory`
2. If `super.getSupportedCodecs()` has an item with name "H264", I create a new `VideoCodecInfo` with param `packetization-mode=0` and whatever the existing `profile-level-id` was and add it to the array returned by getSupportedCodecs(). 

This seems to work fine from my testing on a limited set of testing devices. 
If it is valid I'm not sure why WebRTC does not return this by default. 
Reply all
Reply to author
Forward
0 new messages