Repository navigation
utils: Count rescaled encoders in GetStats output frames - #4
Merged
Merged
Conversation
GetStats read outputTotalFrames and outputSkippedFrames from obs_get_video(), the main video mix. An encoder that rescales the output on the GPU (Settings > Output > Rescale Output) encodes from a video mix of its own, so while such an encoder ran, GetStats reported 0 / 0 and never showed encoding lag, even when OBS's Stats dock showed frames being skipped. obs-rust's libobs now has obs_get_video_frame_counts(), which counts the main mix and the mixes of rescaling encoders on it, each once; the Stats dock and the status bar already use it. Use it here too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 14, 2026
zackees
pushed a commit
to rdoupe/obs-studio
that referenced
this pull request
Oct 14, 2026
obs-rust#337 made OBS's Stats dock and status bar count the frames of encoders that rescale the output (Rescale Output), which encode from a video mix of their own. obs-websocket's GetStats still read obs_get_video(), the main mix, so while only a rescaled recording ran it reported outputSkippedFrames / outputTotalFrames = 0 / 0. obs-rust/obs-websocket#4 takes both values from obs_get_video_frame_counts(), like the Stats dock. That fix already shipped with the submodule pin to 547f5ea; this adds the regression test. Add a Tier 4 phase: the suite can now start OBS on a profile written before launch, and "stats with Rescale Output" records at 640x360 from a 1280x720 canvas for 3 seconds and checks that GetStats counts the frames. It retries StartRecord while the server answers 207 (NotReady) during frontend startup. OBS is now started with --multi, so another OBS on the same machine does not hold it at the single-instance dialog. The phase fails with 0 / 0 with the submodule at caf0527, the fork commit before obs-rust#4 was merged, and passes at 547f5ea. Refs obs-rust#514. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=2586eb5231297f7e5ac0663ab8afd50d7755feea secs=528 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1792004952,"gate":"rust/all/fmt","host":"linux-x86_64","key":"fb9af536766902129ece46b231d51d356c88cd44b7a4ae4278693b9589973c1d","lane":"lint","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":53,"stamp":"522c5232d38c5379b2dbdf95d6745ae5","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"fb9af536766902129ece46b231d51d356c88cd44b7a4ae4278693b9589973c1d","lane":"lint","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":53,"stamp":"f72e64d0d7ce082ae99190cd946305de","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"f82a96a3ebf8185e9afc6a6936d54c407534dcd196aae1a51d822fd4982f8c3f","lane":"rust-test","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":121,"stamp":"211b88942d2ba50ac8803d0a66ddb031","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"d479cf2a3ac23b07a86c528e60bee7f4","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"a48f50b7437a052e74e2aa246a68bc7a","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"2b3f87af06084f79f56949749d6f7c82","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"c5a41a7056c65e335124d197bda80fd4","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"f85c003f8e3ecc00d28d7870ed9b8e24","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"89a7bf52adb3b008dd2dd6eeb5cfdb92","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"c0c4ea416ea70ee6dcb2acee436be364dea927882183c8c32e588e15bab63775","lane":"tier2-linux","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":244,"stamp":"9c59ada4512d7f5b22fc44fe799716d9","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"}
zackees
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 14, 2026
…-rust#751) obs-rust#337 made OBS's Stats dock and status bar count the frames of encoders that rescale the output (Rescale Output), which encode from a video mix of their own. obs-websocket's GetStats still read obs_get_video(), the main mix, so while only a rescaled recording ran it reported outputSkippedFrames / outputTotalFrames = 0 / 0. obs-rust/obs-websocket#4 takes both values from obs_get_video_frame_counts(), like the Stats dock. That fix already shipped with the submodule pin to 547f5ea; this adds the regression test. Add a Tier 4 phase: the suite can now start OBS on a profile written before launch, and "stats with Rescale Output" records at 640x360 from a 1280x720 canvas for 3 seconds and checks that GetStats counts the frames. It retries StartRecord while the server answers 207 (NotReady) during frontend startup. OBS is now started with --multi, so another OBS on the same machine does not hold it at the single-instance dialog. The phase fails with 0 / 0 with the submodule at caf0527, the fork commit before #4 was merged, and passes at 547f5ea. Refs obs-rust#514. Local-Gate: v1 tree=2586eb5231297f7e5ac0663ab8afd50d7755feea secs=528 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1792004952,"gate":"rust/all/fmt","host":"linux-x86_64","key":"fb9af536766902129ece46b231d51d356c88cd44b7a4ae4278693b9589973c1d","lane":"lint","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":53,"stamp":"522c5232d38c5379b2dbdf95d6745ae5","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"fb9af536766902129ece46b231d51d356c88cd44b7a4ae4278693b9589973c1d","lane":"lint","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":53,"stamp":"f72e64d0d7ce082ae99190cd946305de","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"f82a96a3ebf8185e9afc6a6936d54c407534dcd196aae1a51d822fd4982f8c3f","lane":"rust-test","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":121,"stamp":"211b88942d2ba50ac8803d0a66ddb031","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"d479cf2a3ac23b07a86c528e60bee7f4","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"a48f50b7437a052e74e2aa246a68bc7a","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"2b3f87af06084f79f56949749d6f7c82","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"c5a41a7056c65e335124d197bda80fd4","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"f85c003f8e3ecc00d28d7870ed9b8e24","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"525209b94219c953eac4c0a7dc73aa9c42c3767378810ea5160b1b49650d3bfa","lane":"cross","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":109,"stamp":"89a7bf52adb3b008dd2dd6eeb5cfdb92","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Ci-Attestation: {"at":1792004952,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"c0c4ea416ea70ee6dcb2acee436be364dea927882183c8c32e588e15bab63775","lane":"tier2-linux","parents":["d9328f4c24bb4ceb49c67e3abb0cd4d74b453f2e"],"secs":244,"stamp":"9c59ada4512d7f5b22fc44fe799716d9","tree":"2586eb5231297f7e5ac0663ab8afd50d7755feea","v":1,"via":"run"} Co-authored-by: Claude Opus 5.5 <[email protected]>
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
GetStatsnow counts the frames of encoders that rescale the output. Before, while a recording with Rescale Output ran, it reportedoutputSkippedFrames/outputTotalFrames= 0 / 0 and never showed encoding lag.Utils::Obs::ObjectHelper::GetStats()(src/utils/Obs_ObjectHelper.cpp) read both values fromobs_get_video(), the main video mix. An encoder that rescales the output (Settings > Output > Recording > Rescale Output) encodes from a video mix of its own, which that mix doesn't count.obs_get_video_frame_counts()(libobs, frontend: Count encoding lag of encoders that rescale the output obs-studio#337). It counts the main mix and the mixes of rescaling encoders on it, each once, and OBS's Stats dock and status bar already use it.GetStatsnow uses it too. Nothing else changes.This builds only against obs-rust's libobs (
obs_get_video_frame_counts()isn't in upstream OBS).Motivation and Context
Fixes obs-rust/obs-studio#514, the obs-websocket half of obs-rust/obs-studio#337 (upstream obsproject/obs-studio#11078). #337 listed
GetStatsas a follow-up.How Has This Been Tested?
In obs-rust/obs-studio, with this commit as the submodule (the submodule bump follows once this merges), both libobs lanes:
test/websocket-tier4/run_tier4.py), new phase "stats with Rescale Output" (records at 640x360 from a 1280x720 canvas for 3 s):GetStatsgives 0 / 104 frames; before this commit 0 / 0. The rest of the suite is unchanged (185 of 186;GetVirtualCamStatusfails without a v4l2loopback device, before and after).Types of changes
🤖 Generated with Claude Code