Skip to content

test: Cover GetStats output frames with Rescale Output in Tier 4 - #751

Merged
zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/getstats-rescale-bump
Oct 14, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/getstats-rescale-bump

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a regression test for obs-websocket's GetStats output frame counts with Rescale Output. The fix itself, obs-rust/obs-websocket#4 (utils: Count rescaled encoders in GetStats output frames), already landed in master with the submodule pin to 547f5ea and shipped in v0.1.0-beta.20261014. This PR does not touch the submodule; it only adds the test.

The bug: while a recording with Rescale Output ran, GetStats reported outputSkippedFrames / outputTotalFrames = 0 / 0, the same blind spot #337 fixed in OBS's Stats dock and status bar.

The test is in test/websocket-tier4/run_tier4.py: the suite can now start OBS on a profile written before launch. A new phase, "stats with Rescale Output", starts OBS on an Advanced output profile that records x264 at 640x360 from a 1280x720 canvas (Rescale Output, bilinear), records for 3 s and checks that GetStats counts the frames, then stops the recording and lets it finish before OBS exits. It retries StartRecord while the server answers 207 (NotReady) during frontend startup, as the auth phase already does for GetVersion. The suite also starts OBS with --multi now, so another OBS on the same machine can't hold it at the single-instance dialog. The wait for the previous OBS to release the port is now a helper, used before both later phases.

Motivation and Context

Refs #514.

This is a follow-up of our #337 (upstream obsproject/obs-studio#11078). #337 fixed Stats and the status bar and listed GetStats under "Not tested"; the fork fix closed that gap, and this PR adds the test that was missing for it.

Why this one: stream-deck, bot and overlay users who watch encoder lag over obs-websocket get no warning if this regresses, and nothing else in the repo exercises GetStats with Rescale Output.

How Has This Been Tested?

On top of current master, in both libobs lanes (ENABLE_RUST_LIBOBS OFF and ON), with OBS built with the frontend and obs-websocket, Tier 4 suite (test/websocket-tier4/run_tier4.py --obs <build>/rundir/RelWithDebInfo/bin/<obs binary>, websockets 13.1):

  • RED: with the submodule checked out at caf0527 (the fork commit before meta: Rust port unit-testing roadmap, phases 2–5 #4 was merged, the first parent of ee7b938), 184 of 186: stats:outputTotalFrames counts a rescaled recording fails with recording active=True outputSkippedFrames=0 outputTotalFrames=0, in both lanes. caf0527 predates the fork's ImageFormat.h include fix, so for this run only the plugin carried that one-line include on top; without it the plugin does not compile in a build with the frontend.
  • GREEN: at 547f5ea (master's pin), 185 of 186, the new phase passes in both lanes (stats:rescaled recording starts, stats:outputTotalFrames counts a rescaled recording, stats:outputSkippedFrames <= outputTotalFrames). The other failure is req:GetVirtualCamStatus (604, "VirtualCam is not available."): this machine has no v4l2loopback device, and it fails the same before and after. 147 of 147 documented request types exercised.
  • Full ctest (private Xvfb, system OpenGL module masked as in CI, TMPDIR unset): 211 of 211 in each lane, with every PipeWire and PulseAudio test actually run. The skips are open_crashes_without_obs_core and master's test_startup_alloc_stable / test_startup_cycle_stress, which skip here under the nested Xvfb harness and are not touched by this PR.

Not tested:

  • The Tier 4 suite doesn't run in CI (no workflow calls run_tier4.py), so CI won't exercise the new phase; the runs above are the evidence.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, the test, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

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

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Rebased onto master and ran the stamped local gate. Your RED (caf0527: outputTotalFrames=0 with a rescaled recording) / GREEN evidence above stands.

  • Rebased on master, local gate passed; pushed as 3b564f8.

@zackees
zackees force-pushed the fix/getstats-rescale-bump branch from b1a58f8 to 3b564f8 Compare October 14, 2026 19:09
@zackees
zackees added this pull request to the merge queue Oct 14, 2026
Merged via the queue into obs-rust:master with commit 777aec4 Oct 14, 2026
20 checks passed
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.

2 participants