Skip to content

obs-ffmpeg: Fix SVT-AV1 rate-control options - #63

Merged
zackees merged 2 commits into
masterfrom
fix/svt-av1-rate-control
Oct 9, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/svt-av1-rate-control

Conversation

@zackees

@zackees zackees commented Oct 9, 2026

Copy link
Copy Markdown
Member

Fixes #24. This is a rebase of #27 by @icp4u onto current master; both commits keep icp4u as the author.

Changes from #27:

Fix: OBS set its SVT dictionary on svtav1_opts, FFmpeg's internal member name, instead of the public svtav1-params AVOption. The failure was ignored, so the CBR override rc=2 was lost. The fix sets svtav1-params after the custom FFmpeg options, merging OBS defaults without overwriting explicit user values. It drops the obsolete bias-pct and the redundant tbr (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):

  • With the old obs-ffmpeg-av1.c, 6 of 8 cases fail: svt_cbr, svt_vbr, svt_cqp, svt_custom_tuning_keeps_cbr, svt_option_failure and svt_encode_smoke.
  • With the fix, all pass. 23/23 tests pass with OFF and ON, and both builds export the same 1752 symbols.

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

icp4u and others added 2 commits October 9, 2026 12:13
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"}
@zackees
zackees merged commit d45b2f2 into master Oct 9, 2026
22 checks passed
@zackees
zackees deleted the fix/svt-av1-rate-control branch October 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

SVT-AV1 ignores CBR rate control (upstream #13849)

2 participants