When using H264 for WebRTC the resolution won't adjust to reduce bitrate
Categories
(Core :: WebRTC: Audio/Video, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox101 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: jrmuizel)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
This is reproducible using https://jsfiddle.net/jib1/02j8q6h9/show and adjusting the max bitrate.
In Chrome the resolution will drop. In Firefox it mostly doesn't.
Assignee | ||
Comment 1•3 years ago
|
||
It looks like this happens because our external decoders don't implement GetEncoderInfo()
Assignee | ||
Comment 2•3 years ago
|
||
In addition to implementing GetEncoderInfo we also need to set EncodedImage.qp to useful values.
https://searchfox.org/mozilla-central/rev/a019f4f233dc43af0ade38be0914010448c4ce03/third_party/libwebrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc#485
https://bugs.chromium.org/p/webrtc/issues/detail?id=12542 is what was needed to set qp for the hardware encoders.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
This is a cherry-pick of 0e42cf703bd111fde235d06d08b02d3a7b02c727
Assignee | ||
Comment 5•3 years ago
|
||
It looks like this would probably be completely fixed by upstream.
It looks like the conditions for quality_scaling_allowed have been changed so that it no longer depends on GetEncoderInfo:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/adaptation/video_stream_encoder_resource_manager.cc;l=602;drc=e62c2f2c77bca9af93b1f8cc5a37bb9978a18844
Assignee | ||
Comment 6•3 years ago
|
||
Other relevant pieces:
- qp can't be trusted on some hardware encoders: https://bugs.chromium.org/p/webrtc/issues/detail?id=12942
- deal with unreliable qp: https://webrtc.googlesource.com/src/+/f2707706798c072c63a7be5a4ed5850912a201d8
This notes the unreliability of qp on Windows Intel:
https://source.chromium.org/chromium/chromium/src/+/8134fb23c15b2e14fc5e24352751ef4f12bd6d7f
The bandwidth scaler used when unreliable qp:
https://webrtc.googlesource.com/src/+/f2707706798c072c63a7be5a4ed5850912a201d8
Also worth noting, has_trusted_rate_controller seems to only be true on Linux and Windows
Updated•3 years ago
|
Comment 8•3 years ago
|
||
bugherder |
Description
•