Repository navigation
Description
Upstream OBS bug, reported by nickcharlesyt in obsproject/obs-studio#11078. The same thing is reported in obsproject/obs-studio#10744 (TheMasterofBlubb), obsproject/obs-studio#11551 (walker-WSH, who found the cause) and obsproject/obs-studio#11907 (CatKasha, the missing overload warning). The code has not changed in this fork.
Location
frontend/widgets/OBSBasicStats.cppInitializeValues()andUpdate(), andfrontend/widgets/OBSBasicStatusBar.cppActivate()andUpdateStatusBar(): "Skipped frames due to encoding lag" and the "encoder overloaded" warning readvideo_output_get_total_frames()/video_output_get_skipped_frames()ofobs_get_video(), the main video mix.libobs/obs-encoder.cmaybe_set_up_gpu_rescale(): an encoder with a GPU scaled size (Settings > Output > Rescale Output) is moved onto an encoder-only video mix of the same canvas. That mix'svideo_tcounts the frames it hands to the encoder and the frames it skips. Nothing reads it, so the main mix stays at 0 / 0.
obs-websocket's GetStats (outputSkippedFrames, outputTotalFrames) reads the same counters.
Class
Status reporting: with Rescale Output on, Stats shows 0 / 0 skipped frames and an overloaded encoder never triggers the status bar warning (or the tray notification). Users get no sign that their recording or stream is dropping frames.
How it is reached
- Settings > Output (Advanced) > Recording or Streaming > Rescale Output set to any resolution, then start recording or streaming. Stats shows "0 / 0 (0.0%)".
- The same with an encoder that cannot keep up (for example x264 on a slow preset): no "Encoding overloaded" message, and Stats still shows 0 skipped frames. libobs itself logs the skipped frames for the rescaled mix when the output stops.
- Enhanced Broadcasting (multitrack video) creates its encoders with scaled sizes on the main canvas too, so it goes through the same path.
Reproduced headlessly with libobs: a raw video encoder on a 64x64, 30 fps canvas, scaled to 32x32 with GPU scaling, counted while it runs for 1.5 s. The main mix reports 0 frames and 0 skipped. Without scaling it reports 45 frames, and with an encoder that takes 100 ms per frame, 15 frames with 8 skipped. libobs logs "skipped frames due to encoding lag: 21/34" for the rescaled mix when it stops.
Previous attempts upstream
- libobs: Fix bug with frame count in stat card obsproject/obs-studio#10866 (deltamaya) also counted the rescaled mix's frames on the main mix. It was closed after derrod pointed out that it would also count encoders on other canvases (a vertical canvas plugin) as the main mix's.
- UI: Fix stats window obsproject/obs-studio#10867 (deltamaya) read the video of the streaming or the recording encoder in Stats. It was closed without being merged. It covers one output at a time and not the status bar, and the frontend would read the encoder's mix without any lock while the output stopping can free it.
Proposed fix and failing test
Fix: add obs_get_video_frame_counts(uint32_t *total, uint32_t *skipped) to libobs. It sums the counters of the main canvas's mix and of the encoder-only mixes made for that canvas's rescaling encoders, each mix once, under mixes_mutex (the lock an encoder-only mix is freed under). Mixes of other canvases and views are not counted. Stats and the status bar call it instead of reading obs_get_video(). The status bar starts counting again when the totals drop (a rescaling encoder's mix goes away when it stops), as Stats already does.
RED test (cmocka, test_encoding_lag_rescale) with six cases, each running an output for 1.5 s:
- rescaled encoder: frames are counted;
- rescaled encoder that takes 100 ms per frame: skipped frames are counted;
- two rescaled encoders that share one mix: the mix is counted once;
- guard: unscaled encoder;
- guard: unscaled encoder that takes 100 ms per frame;
- guard: a rescaled encoder on a second canvas is not counted.
The first three fail today and the guards pass.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 12, 2026
Claiming: this issue.
test_encoding_lag_rescale(3 of 6 failing): fast and slow encoders with and without GPU rescale through real libobs; the counts Stats and the status bar read must include the rescaled encoder's mix, once, and leave other canvases out.obs_get_video_frame_counts()sums the main mix and its encoder-only mixes under the mixes lock; Stats and the status bar use it.PR today.
libobs, frontend: Count encoding lag of encoders that rescale the output
test/cmocka: Add failing test for encoding lag with Rescale Output
rdoupe commentedon Oct 12, 2026
@nickcharlesyt you reported this in obsproject/obs-studio#11078, so a heads-up: it's fixed here in obs-rust by #337, merged today with a regression test.
Cause: with Rescale Output on, the encoder doesn't take frames from the main video mix; libobs gives it its own scaled mix, and that mix counts the frames it sends and skips. Stats and the status bar only read the main mix, so they showed 0 frames and 0 skipped, and the "encoding overloaded" warning never appeared even though libobs logged the skips at the end of the recording. walker-WSH found that cause in obsproject/obs-studio#11551, TheMasterofBlubb and CatKasha reported the same thing, and deltamaya's earlier upstream attempts pointed the way. Now libobs adds up the main mix and the scaled encoder mixes (each once, other canvases left out), and Stats and the status bar use that. The test runs fast and deliberately slow encoders with and without rescaling through real libobs: before, a rescaled encoder showed 0/0; now it shows its real frame and skip counts.
Not covered: the Stats window and status bar themselves weren't run (they were compiled and changed to read the new counts); obs-websocket's GetStats still reads only the main mix.
Workaround on stock OBS: the end-of-recording summary in the log still has the real skipped-frame numbers for the scaled encoder.
obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you try it, a short reply here on whether Stats now counts your rescaled recording would really help.