PSA: OpenH264 update coming in M129 (with a bitstream change)

459 views
Skip to first unread message

Philipp Hancke

unread,
Jul 25, 2024, 9:04:30 AM7/25/24
to discuss...@googlegroups.com
tl;dr: if you depend on OpenH264 please read this carefully and test in Canary and Beta.

I just landed a commit that updates the OpenH264 dependency Chromium uses for H264 software encoding (on the constrained baseline profile)
The full changelog is linked in the commit. If everything goes as planned this will land in Chromium 129 stable on September 17th.

The primary reason for updating this was a change in the H264 pic_order_cnt in the SPS generated by OpenH264 from 0 to 2 from
which can be found in the SPS in Wireshark like this:
image.png
The value 2 means that the stream can be decoded instantly as the display order is the same as the decode order and there is no
need to wait for the next frame to determine if the current frame can be played out. See
for a great explanation (or the excellent book on H264 by the same author)

What originally spurred the change was this behavior observed in a webrtc-internals dump:
image.png
which basically shows the decoder waiting for 30ms or one frame for no reason.

This behavior is a known issue on some Android hardware decoders like the one used in Qualcomms Snapdragon chips and quite undesirable for RTC scenarios in general.

For WebRTC on those devices you should see a drop in the per-frame totalDecodeTime returned from getStats to more reasonable values of 4 milliseconds.
As a bonus this also removes two bytes from each frame encoded with OpenH264. This may not sound much but adds up!

If you depend on H264 please test in Canary and Beta

cheers

Philipp

R simons

unread,
Aug 16, 2024, 3:36:09 AM8/16/24
to discuss-webrtc
Hi Philipp, I'm facing a h264 hw decocing issue recently in Qualcomms Snapdragon 680, cannot decoding two video stream with 720p and 30fps same time. I posted a discuss here: https://groups.google.com/g/discuss-webrtc/c/0T7uBRv-ACg

I wonder to know is there a way to force sw h264 decoder on Android Chrome?

I had tried disable hw decoding in chrome://flags, did not work, seems the sw decoder(ffmpeg) is still not supported on Android Chrome yet.
Reply all
Reply to author
Forward
0 new messages