Closed Bug 1765898 Opened 2 years ago Closed 2 years ago

When using H264 for WebRTC the resolution won't adjust to reduce bitrate

Categories

(Core :: WebRTC: Audio/Video, defect, P2)

defect

Tracking

()

RESOLVED FIXED
101 Branch
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.

Blocks: teams

It looks like this happens because our external decoders don't implement GetEncoderInfo()

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.

Severity: -- → S2
Priority: -- → P2

This is a cherry-pick of 0e42cf703bd111fde235d06d08b02d3a7b02c727

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

Other relevant pieces:

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

Depends on: 1766467
Depends on: 1766311
Assignee: nobody → jmuizelaar
Attachment #9273501 - Attachment description: Bug 1765898. Expose get encoder info → Bug 1765898. Expose GetEncoderInfo() for out of tree encoders.
Status: NEW → ASSIGNED
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/edc4088288ca
Expose GetEncoderInfo() for out of tree encoders. r=bwc
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: