Repository navigation
Description
Imported from upstream obsproject/obs-studio#13933 (reported by @AscendancyDotA on 2026-09-25), which was closed as not planned upstream. The original report is quoted below, unedited.
Upstream report
OS: Windows 11 · OBS: 32.2.2 · GPU: RTX 3090, driver 610.62
Expected: an option to disable B-frames when using Twitch Enhanced Broadcasting, or it just works.
Current: with Sunshine + Moonlight remote desktop on NVENC and an OBS NVENC preset p3–p5 with B-frames enabled, there is unusable input lag and stutter. The user still wants Enhanced Broadcasting for its bitrate/HEVC benefits. Twitch's auto-config suggests B-frames on.
Steps to reproduce
- Run a Twitch test stream (Enhanced Broadcasting) plus a remote desktop session.
- Input lag is severe.
- Disable B-frames.
- Runs perfectly, even with double encode.
Log excerpt
[obs-nvenc: 'multitrack video video encoder 0'] settings:
codec: HEVC
rate_control: CBR
bitrate: 9000
keyint: 120
preset: p5
tuning: hq
multipass: qres
profile: main
width: 2560
height: 1440
b-frames: 2
b-ref-mode: 0
lookahead: true (4 frames)
aq: true
user opts: lookaheadDepth=4
Upstream resolution (not planned):
- tiberium-v: "You have to report this to twitch … OBS has no more control over the encoder settings, when enhanced broadcasting is active."
- Fenrirthviti: "… this also feels like a problem with Sunshine/Moonlight and not OBS or Twitch in the first place."
Why it's actionable in this fork
With Enhanced Broadcasting, frontend/utility/MultitrackVideoOutput.cpp (create_video_encoder, ~line 225) builds each encoder's settings straight from the GoLive config: obs_data_create_from_json(encoder_config.settings.dump()). The only local adjustment is a VAAPI profile fix-up, so the user has no way to override bf (B-frames) or lookahead. NVENC's default is bf = 2 (plugins/obs-nvenc/nvenc-compat.c:117), and the UHQ tune forces ≥ 4 (plugins/obs-nvenc/nvenc.c:294).
Proposal (to be decided)
Add an opt-in, user-controlled override applied after the GoLive settings are loaded and before the encoder is created. For example, an advanced setting "Disable B-frames for Enhanced Broadcasting" that sets bf = 0 (and optionally turns lookahead off) on every multitrack video encoder, and logs the override.
Open questions:
- Does Twitch's ingest accept streams whose B-frame count differs from the config it sent? Needs a test stream. If Twitch rejects or penalizes the stream, the option must say so.
- Scope: NVENC only, or every encoder that exposes
bf? - UI placement: Stream settings (Enhanced Broadcasting section) vs. Advanced.
Acceptance criteria
- Repro on Windows + NVENC with Enhanced Broadcasting:
b-frames: 2in the log; with the override on,b-frames: 0and the override is logged. - A test stream to Twitch with the override on is accepted (document the result).
- Default behavior (override off) is unchanged.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
b7216309-jpg commentedon Oct 9, 2026
A concrete plan, so the open questions can be decided before any code is written. I can't build the frontend or run NVENC/Twitch tests on my machine, so I'd rather agree on the design first.
Today there is no workaround for Twitch.
MultitrackVideoConfigOverride(Stream settings → "config override") only takes effect forrtmp_customservices (MultitrackVideoOutput.cpp, theisCustomRtmpServicebranch). With Twitch, the downloaded GoLive config is used as-is.Proposed change
Stream1/MultitrackVideoDisableBFrames(bool, defaultfalse). This follows the existingMultitrackVideo*keys read inBasicOutputHandler.cpp, and is passed intoMultitrackVideoOutput::PrepareStreamingalongsidemaximum_video_tracksetc.create_video_encoder(MultitrackVideoOutput.cpp), right afterencoder_settingsis built fromencoder_config.settingsand beforeobs_video_encoder_create. If enabled and the encoder exposes abfproperty, setbf = 0. Log a line next to the existing per-encoder logging, e.g.MultitrackVideoOutput: B-frames disabled by user override (encoder 0: bf 2 -> 0). The[obs-nvenc] settings:dump then showsb-frames: 0, which is the acceptance check.QCheckBoxin the existingmultitrackVideoGroupBox(OBSBasicSettings.ui), next tomultitrackVideoStreamDumpEnable/multitrackVideoConfigOverrideEnable. Label something like "Disable B-frames (lower latency; may not match the service's recommended settings)". Hook it like the others (STREAM1_CHANGED), with a string inen-US.ini.nvenc.c; withbf = 0requested, we should log rather than silently fight the tune), and the GoLive POST.Decisions needed
bfsetting? Several read it: obs-nvenc, ffmpeg-nvenc, x264, QSV. I'd suggest every encoder that has the property, since the user's intent is "no B-frames" and checkingobs_properties_get(props, "bf")handles it generically.lookahead(NVENC) with the same switch? The report's log showslookahead: true (4 frames), which also adds latency. I'd keep it separate or leave it out at first.Once these are decided, I can write the PR. Someone with an NVENC GPU will need to do the Twitch test stream from the acceptance criteria, since I can't.
nathan-v commentedon Oct 10, 2026
Working on this now.
test: Fail Enhanced Broadcasting override decisions against stubs
frontend: Apply Enhanced Broadcasting overrides through tested helpers
frontend: Move the encoding ladder preview out of the override change
test: Fail Enhanced Broadcasting override decisions against stubs
frontend: Apply Enhanced Broadcasting overrides through tested helpers
test: Fail Enhanced Broadcasting override decisions against stubs
frontend: Apply Enhanced Broadcasting overrides through tested helpers
test: Fail the encoding ladder preview against an empty stub
frontend: Fill the encoding ladder preview through the tested helper
frontend: Preview the Enhanced Broadcasting encoding ladder
test: Fail the encoding ladder preview against an empty stub
frontend: Fill the encoding ladder preview through the tested helper