Repository navigation
Conversation
FFmpeg's libsvtav1 encoder exposes its private parameter dictionary as the AVOption 'svtav1-params', but OBS assigned it using the internal SvtContext member name 'svtav1_opts'. This caused av_opt_set_dict_val() to fail silently (its return value was ignored), so the 'rc=2' CBR override never reached SVT-AV1 and the encoder stayed in VBR. Also remove two dictionary entries that are obsolete or redundant for current SVT-AV1: - 'bias-pct' is no longer registered in SVT-AV1 >= 2.0.0. - 'tbr' duplicated AVCodecContext::bit_rate (which FFmpeg already maps to target_bit_rate) and used the wrong unit. Check the av_opt_set_dict_val() return value so an AVOption assignment failure is no longer silently ignored. Fixes obsproject#13849
This was referenced Oct 9, 2026
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
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
FFmpeg's
libsvtav1encoder exposes its private SVT parameter dictionary as the AVOptionsvtav1-params, but OBS assigned it using the internalSvtContextmember namesvtav1_opts. As a resultav_opt_set_dict_val()failed to find the option and silently did nothing (its return value was ignored), so therc=2CBR override never reached SVT-AV1 and the encoder stayed in VBR even when CBR was selected.This also fixes two additional issues in the dictionary that were hidden while assignment was failing:
bias-pct, which is no longer registered in SVT-AV1 >= 2.0.0.tbr, which was redundant (FFmpeg already mapsAVCodecContext::bit_ratetotarget_bit_rate) and used the wrong unit.The return value of
av_opt_set_dict_val()is now checked so an AVOption assignment failure is logged instead of silently ignored.Motivation and Context
Fixes #13849.
How Has This Been Tested?
Verified against FFmpeg's
libsvtav1encoder (SVT-AV1 v4.0.1) on macOS:svtav1_optsis rejected:Unrecognized option 'svtav1_opts'. Option not found— confirming the original bug (the dict assignment silently failed).svtav1-paramsis accepted and the encoder starts normally (rc=2CBR override reaches SVT-AV1).bias-pctis confirmed no longer registered in SVT-AV1 >= 2.0.0: passing it yieldsError parsing option bias-pct, so removing it is correct.tbrremoval is correct since FFmpeg mapsAVCodecContext::bit_ratetotarget_bit_rate.Types of changes
Checklist: