Add multitrack video dynamic bitrate support
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:
- https://github.com/obsproject/obs-studio/pull/12003
- https://github.com/obsproject/obs-studio/pull/12004
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:
15:12:49.701: [qsv encoder: 'multitrack video video encoder 1'] Failed to reconfigure
15:12:50.009: [qsv encoder: 'multitrack video video encoder 0'] Failed to reconfigure
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.
2025.08.08 Update: The PR has been updated to not invoke DBR if the encoder is Intel QSV. The OBS hang issue is no longer happening with the code available at https://github.com/obsproject/obs-studio/pull/12481, however the IDRs are not aligned across the segments. Once the issue is identified and fixed, reverting the last commit in this PR should be only change needed to enable multitrack DBR for Intel.
Types of changes
- New feature (non-breaking change which adds functionality)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [ ] I have included updates to all appropriate documentation.
This can be rebased now that #12003 and #12004 are merged. Remove the changes to all locale files except
en-US.ini, as the others will be written/overwritten when we pull in translations.
Thanks for the tip re: locale files. Changes have been made and rebased to master.