support for decoding of H264 b-frames WebRTC

1,848 views
Skip to first unread message

umedia

unread,
May 24, 2018, 10:57:10 AM5/24/18
to discuss-webrtc
Hello,

We know WebRTC was designed for p2p; b-frames increase playback latency, so H264 in WebRTC should not contain b-frames.
However, modern WebRTC use is beyond p2p and communication; server-based solutions allow streaming of any H264-encoded content to WebRTC players in browsers.
Regular IPTV channels containing b-frames in H264 streams, play weirdly with WebRTC: video jumps back and forth - obviously, that's a b-frames issue.

We see that problem with our Unreal Media Server when we ingest an IPTV HLS stream and (without video transcoding, but with transcoding AAC to Opus using Unreal Live Server)  stream it to WebRTC player.

You might say - that's a bad idea to play IPTV via WebRTC, and I don't necessarily disagree with you, but pure technically - why not? Should be possible.  

Native c++ webrtc code does not provide any way to supply PTS and DTS with coded frame. It's just one timestamp on the coded video frame (H264 NALU). I know that.
But ffmpeg H264 decoder that WebRTC uses, can perfectly decode a stream with b-frames; in fact, any decent H264 decoder can do that. 
It's rather a video renderer problem that does not receive the right presentation timestamps from decoder; it assumes that timestamps passed in RTP are presentation timestamps, which is not true for b-frames.

So maybe IPTV playback in WebRTC player is not that practical, but there are high-end live encoders that encode high profile with b-frames, and yes, there will be a little latency penalty, but big bandwidth savings using b-frames,
so that is a very practical use. One very available example to reproduce that issue - take free FMLE live encoder and push encoded video (H264 High profile) to Unreal Media Server. Then play with WebRTC player. 

So just a feature suggestion here. Would be nice if you don't force the server side to pass both DTS and PTS (in fact it's not easy via RTP), but handle it in the player (decoder re-arranges presentation timestamps and passes them to video renderer).

Alexandre GOUAILLARD

unread,
May 24, 2018, 5:47:55 PM5/24/18
to discuss...@googlegroups.com
For bigger impact, you might want to open a bug ticket, and write your proposal there.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/d00ad832-9151-4e35-a494-b63bc1366019%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

umedia

unread,
May 28, 2018, 3:44:52 AM5/28/18
to discuss-webrtc
Hi Alexandre,

Where do I open such a bug ticket?

mbon...@webrtc.org

unread,
May 28, 2018, 3:48:11 AM5/28/18
to discuss-webrtc
On Monday, May 28, 2018 at 9:44:52 AM UTC+2, umedia wrote:
Hi Alexandre,

Where do I open such a bug ticket?

Hi, you can open it here: https://bugs.webrtc.org
Reply all
Reply to author
Forward
0 new messages