Repository navigation
obs-ffmpeg: Fix SVT-AV1 rate-control options - #63
Merged
Merged
Conversation
Configure the AV1 encoder through the production av1_update() with real FFmpeg options and check what reaches svtav1-params: CBR must deliver rc=2 with pred-struct=1, without the obsolete bias-pct or a tbr in the wrong units; VBR, CQP, custom options and AOM keep their behaviour; an option failure fails initialization. A small synthetic encode runs the corrected CBR configuration. Skips (77) without libsvtav1. Rebased from #27 onto the cmocka-tests aggregate target. Co-Authored-By: Claude Opus 5.5 <[email protected]>
OBS assigned its SVT parameter dictionary to svtav1_opts, FFmpeg's internal member name, instead of the public svtav1-params AVOption. The call failed, its result was ignored, and the CBR rc=2 override was lost, so CBR encoded as VBR. Set svtav1-params after the custom FFmpeg options, merging OBS defaults without overwriting explicit user values; drop the obsolete bias-pct and the redundant tbr (SVT reads it as kbps, FFmpeg already passes bit_rate); fail initialization with an encoder error if the assignment fails. Fixes #24 Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=761001636f91042a2b5e37f0583c11cbcfcd8a85 secs=45 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791573285,"gate":"rust/all/fmt","host":"linux-x86_64","key":"196c5811d95e6d73982dd882d1ac60528bb7569a504517dd5b43b216f7036b08","lane":"lint","parents":["307bbeb4a5742fd39d41960fd24818a0a1d7479c"],"secs":18,"stamp":"ebbf3b4996f6c4f2e85ac7efbb33ca98","tree":"761001636f91042a2b5e37f0583c11cbcfcd8a85","v":1,"via":"run"} Ci-Attestation: {"at":1791573285,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"196c5811d95e6d73982dd882d1ac60528bb7569a504517dd5b43b216f7036b08","lane":"lint","parents":["307bbeb4a5742fd39d41960fd24818a0a1d7479c"],"secs":18,"stamp":"2c20050592aff7a7dd88c64ba1f655e1","tree":"761001636f91042a2b5e37f0583c11cbcfcd8a85","v":1,"via":"run"} Ci-Attestation: {"at":1791573285,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"5924ec5df0773da9a8d744c189ffb01dd68242dbb7a393eba7425c34adf872a7","lane":"rust-test","parents":["307bbeb4a5742fd39d41960fd24818a0a1d7479c"],"secs":4,"stamp":"08b1e50a56064c1780f040275df999c2","tree":"761001636f91042a2b5e37f0583c11cbcfcd8a85","v":1,"via":"run"} Ci-Attestation: {"at":1791573285,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"9e5af09289d40d9e9fd3f4c2be6e6fb7e0f594f1606d9b252e079bd084ebd1a8","lane":"tier2-linux","parents":["307bbeb4a5742fd39d41960fd24818a0a1d7479c"],"secs":24,"stamp":"9cec724aa50ae367b685dc7cf00b1ca1","tree":"761001636f91042a2b5e37f0583c11cbcfcd8a85","v":1,"via":"run"}
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.
Fixes #24. This is a rebase of #27 by @icp4u onto current
master; both commits keep icp4u as the author.Changes from #27:
cmocka-testsaggregate target (ci: enable soldr shims for Windows Rust Tier 2 (soldr 0.9.31 / zccache 1.15.2) #25), so the edits to the threevalidatescripts aren't needed and are dropped. Those edits are why obs-ffmpeg: Fix SVT-AV1 rate-control options #27 conflicts.Fix: OBS set its SVT dictionary on
svtav1_opts, FFmpeg's internal member name, instead of the publicsvtav1-paramsAVOption. The failure was ignored, so the CBR overriderc=2was lost. The fix setssvtav1-paramsafter the custom FFmpeg options, merging OBS defaults without overwriting explicit user values. It drops the obsoletebias-pctand the redundanttbr(which was in the wrong units), and fails initialization with an encoder error if the assignment fails.RED → GREEN (Linux Docker, which has libsvtav1, so the test runs instead of skipping):
obs-ffmpeg-av1.c, 6 of 8 cases fail:svt_cbr,svt_vbr,svt_cqp,svt_custom_tuning_keeps_cbr,svt_option_failureandsvt_encode_smoke.The local gate is stamped. Without libsvtav1 the test skips (exit 77). CI will show whether it builds on macOS and Windows.
🤖 Generated with Claude Code