Skip to content

obs-webrtc: Allow B-frames for AV1#13393

Open
Bleuzen wants to merge 1 commit intoobsproject:masterfrom
Bleuzen:whip-av1-bf
Open

obs-webrtc: Allow B-frames for AV1#13393
Bleuzen wants to merge 1 commit intoobsproject:masterfrom
Bleuzen:whip-av1-bf

Conversation

@Bleuzen
Copy link
Copy Markdown
Contributor

@Bleuzen Bleuzen commented May 3, 2026

Description

This change allows to use AV1 B-frames for the WHIP output.

Motivation and Context

Current browsers do have problems with B-frames in WebRTC, however this limitation only applies to H264 and HEVC.
When used with AV1 they do not cause problems.
Therefore OBS should not force disable B-frames if the video codec is AV1.

How Has This Been Tested?

Started a WHIP stream with different codecs and made sure the number of b-frames in the log looks correct.

Watched an AV1 stream with b-frames using Broadcast Box in a browser.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Bleuzen
Copy link
Copy Markdown
Contributor Author

Bleuzen commented May 3, 2026

I found this comment:

It's not WebRTC by itself that has problems with B-frames, it's the implementation inside most browsers.

If this is correct the problem with b-frames seems to be on the viewers side.
Disabling b-frames in OBS currently assumes that every WHIP stream will be watched using WHEP in a browser.
Does this assumption even make sense?
For example the stream could be watched using a different protocol or application which supports b-frames.
In which case we could just remove this line:
obs_data_set_int(video_settings, "bf", 0);

However I guess this might not be a good user experience because most users using WHIP most likely watch the resulting streams using WHEP in a browser which doesn't support b-frames so if we completely remove the line it might result in some users complaining why their streams hang.

If we do this projects like Broadcast Box should add an error message informing the user that their browser can't play the stream if it uses b-frames with H26x.

Not sure what is the best way to handle this. What do you think?

@WizardCM WizardCM added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label May 6, 2026
Comment thread plugins/obs-webrtc/whip-service.cpp Outdated
@Bleuzen Bleuzen requested a review from notr1ch May 7, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants