-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Add multitrack video dynamic bitrate support #12097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lexano-ivs
wants to merge
5
commits into
obsproject:master
Choose a base branch
from
amazon-contributing:lexano/multitrack-dbr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add multitrack video dynamic bitrate support #12097
lexano-ivs
wants to merge
5
commits into
obsproject:master
from
amazon-contributing:lexano/multitrack-dbr
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RytoEX
requested changes
Apr 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also reconfigure all grouped encoders on the same frame.
The bitrate interpolation points are sent in JSON configuration and need to be forwarded to `create_video_encoders()`. Also remove the `HandleIncompatibleSettings()` handler because there are no longer any incompatible settings.
The `amf_xxx_update()` functions for AVC, HEVC, and AV1 are unconditionally invoking Flush() and ReInit() even though this is not required in all situations. Changing the bitrate at least in CBR mode does not require the flush operation and can result in unaligned IDR frames across members of an encoder group. Do not flush the pipeline for CBR bitrate changes; instead, force an IDR to occur with the bitrate change.
Remove the locale strings that are no longer needed now that `HandleIncompatibleSettings()` is removed.
3a9ce08
to
f27d84a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Dynamic bitrate (or DBR to keep it short), is a beta feature enabled via Settings -> Advanced -> Network -> "Dynamically change bitrate to manage congestion (Beta)" in the OBS GUI. This feature automatically modulates the video bitrate based on network bandwidth to avoid dropping frames. Support for DBR with multitrack video had been disabled in OBS while it was being tested in the TEB (Twitch Enhanced Broadcasting) beta program. This PR adds support for multitrack video dynamic bitrate.
Note that this PR depends on 2 previous PRs, due to a shared common function
HandleIncompatibleSettings()
that requires changes in all 3 PRs:The dependent PRs were merged as of 2025.04.30 and this PR has been rebased against
master
.Motivation and Context
Multitrack video sends several video streams in parallel hence uses more overall bandwidth than sending a single stream. In some cases the streamers' available uplink bandwidth is not adequate for multitrack video, so modulating the bitrate on each stream is needed.
How Has This Been Tested?
Testing of multitrack DBR has been occurring for several months in the TEB beta program. In addition, it has been locally tested with NVIDIA GPUs, AMD GPUs (9070XT and 7800XT), and Intel Arc A770.
NVIDIA GPUs work well with multitrack DBR.
AMD GPUs also showed issues with DBR, however this PR introduces changes that forces IDRs on the appropriate frame without needing to flush or reinitialize the AMF pipeline to solve the issues.
The Intel Arc A770 test revealed an issue:
The failure to reconfigure resulted in all streams ceasing to transmit data and an eventual hang of OBS which needed to be terminated with Task Manager. The multitrack DBR feature checks if the encoder supports reconfiguration (it looks for
OBS_ENCODER_CAP_DYN_BITRATE
. It is possible that Intel Arc GPUs do not support reconfiguration but have the bit set. This requires further investigation and testing.Types of changes
Checklist: