Repository navigation
Watch the take while it records - #10
Conversation
TakeMonitor subscribes to InputVolumeMeters for the length of a take and records each input's loudest level after volume and mute, warning when an input on a recorded track is audible and silence was expected. It polls GetStats for skipped frames, and samples the program output as a 32px PPM screenshot once a second to flag black picture and to record unchanging stretches for trimming. obs-record-clip runs it, reports its findings, and writes them next to a local recording as <name>.take.json. obs://take/current serves the running take. The client can now add high-volume event subscriptions with Reidentify, shared between callers and restored after a reconnect. A Reidentify acknowledgement no longer clears the unapplied-output-settings flag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 350cea4b79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| description: "While obs-record-clip or a recording session runs: audio levels on recorded tracks, skipped " | ||
| + "frames, black or unchanging picture, chapters, and warnings; updates when a warning is raised", |
There was a problem hiding this comment.
Start a monitor for ordinary recording sessions
When a recording is started through obs-start-record—the path obs-record-clip recommends for takes over 50 seconds—nothing creates a TakeMonitor; the only construction is inside recordClip. Consequently this resource returns { "running": false } throughout such a recording despite explicitly advertising support for a recording session. Wire the monitor into the general start/stop recording flow or narrow the resource contract to obs-record-clip.
Useful? React with 👍 / 👎.
| this.listen("RecordStateChanged", (data) => { | ||
| if (data.outputActive === false && !this.stopExpected && data.outputState === "OBS_WEBSOCKET_OUTPUT_STOPPED") { | ||
| this.warn("output", "The recording stopped before it was asked to"); | ||
| } |
There was a problem hiding this comment.
Stop monitoring when OBS stops the recording early
When OBS or an operator stops the recording before the requested duration, this handler only adds a warning. stoppedAtMs remains null and the timers and volume-meter subscription remain active, so obs://take/current continues reporting running: true and polling OBS until the original clip duration expires, even though no take is being recorded. The stopped event should terminate the monitor or otherwise mark the take inactive.
Useful? React with 👍 / 👎.
| stills: [...this.stills, ...this.openSpan(this.stillSince)], | ||
| blanks: [...this.blanks, ...this.openSpan(this.blankSince)], |
There was a problem hiding this comment.
Enforce the still-duration threshold in live summaries
While a take is running, openSpan(this.stillSince) exposes an in-progress still immediately after two matching samples, without checking stillAfterSeconds. With the default settings, obs://take/current can therefore report roughly one-second unchanged spans even though the public contract says only stretches of at least three seconds are recorded; completed summaries later discard the same span in closeStill, making live and final results inconsistent.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX
Stacked on #9.
Why: in the Siftable demo, we only found out about Chrome's audio and the blank 0×0 capture from ffprobe after the take. The monitor catches both while recording.
What
subscribeHighVolume(EventSubscription.InputVolumeMeters)adds a high-volume event with Reidentify (op 3).Identifiedacknowledgement of a Reidentify no longer clears the "output settings not applied yet" flag.TakeMonitor(src/tools/take-monitor.ts) watches three things:GetStatsevery 2 s and warns (rate-limited) when frames are missed rendering or skipped encoding.stills, which Trim dead time from a take; contact sheets #12 will use to trim dead time. If OBS can't return PPM, picture checks switch off and the log says so.obs-record-clipruns the monitor. It reports the findings, treats blank or audio warnings (withexpectSilent) as problems, and writes<name>.take.jsonnext to a local recording.obs://take/currentresource, which sends an update notification on each warning or chapter.frame-sample.ts: a dependency-free P6 PPM decoder, plus black and unchanged-frame checks.Tests
npm run checkpasses: 142 unit, 11 e2e.obs-record-clipflagging an input unmuted mid-take; and the resource.Live, read-only (OBS 32.2.2, no recording started):
supportedImageFormatsincludesppm.A live recording test (unmute Chrome for 5 s mid-take, cover the window) is still gated on approval.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX