Skip to content

Record: camera fixes, mirroring, voice clean-up - #11

Merged
calvin-archastro merged 3 commits into
mainfrom
record-camera
Oct 29, 2026
Merged

calvin-archastro merged 3 commits into
mainfrom
record-camera

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Camera takes crashed, and stills of new takes left layers out. Found while testing the camera after #10. This PR also adds the next Record features: mirroring and voice clean-up.

Fixes

  • Cameras with fixed frame rates (C920). The camera offers 30.00003 fps and refuses a frame duration of exactly 1/30, so the recorder crashed as soon as a camera was chosen. It now uses the camera's own duration for that rate.
  • Layers missing from stills. ctl frame and the viewer's still dropped any video frame lasting under half a frame. Every take starts with a held frame a few milliseconds before the first real one, so the camera (and sometimes the screen) disappeared for the first second.
    • The still filter now passes the last frame (fps=…:eof_action=pass). This also helps variable-rate footage from phones.
    • The recorder no longer writes a frame within 10 ms of the previous one.
  • Square bubble in the live preview. gpui clips to rectangles, so the round bubble showed as a square. Camera preview frames now arrive cut to the part the scene shows, and are drawn round themselves.
  • record setup restarts stopped sources. Before, it only restarted them when the setup had changed.

Mirror

  • Any picture. Look.mirror flips a picture left to right, before its crop, mask and hidden box. The viewer and export share the same filters, so both use one hflip. It's in the inspector under "Crop and mirror", and in ctl as look --mirror.
  • The camera in Record. A Mirror switch in the scene bar (record setup --mirror) flips the live preview and brings each take's camera clip in mirrored. camera.mp4 itself is never flipped.
  • Old projects unchanged. Unflipped looks save as before (mirror is left out).

Voice clean-up (like OBS's mic filters)

  • What it does. Clip.clean runs three steps:
    • It cuts rumble below 80 Hz.
    • It lowers steady noise (afftdn). Its noise floor rises with the strength setting, and that floor mattered more than the reduction amount.
    • Optionally, it evens out the level (dynaudnorm). In tests this lifted a quiet voice from −32 to −23 dB and held a loud one back slightly, while noise in pauses stayed below the original. A compressor with make-up gain raised the room noise instead, so it was dropped.
  • Measured on the C920's own room noise: at the default strength the noise drops about 5 dB, with the voice nearly unchanged. It runs about 25× faster than anlmdn for the same result, and doesn't shift timing.
  • Export and playback match. One filter list serves both: the viewer decodes a cleaned clip's sound in the background, as it already did for retimed clips.
  • Where to find it.
    • Inspector: Sound › "Clean up the voice", with a Noise slider and "Even out the level".
    • ctl: clean --clip C [--noise F] [--even/--no-even] | --off.
    • Record: a switch under the mic (record setup --clean), so each take's mic clip comes in cleaned. microphone.m4a stays as recorded.

Tested by hand:

  • C920 plus mic plus screen plus system sound: each take writes all four files, and the bubble and side-by-side layouts render as expected in ctl frame.
  • A mirrored take's camera clip comes in flipped.
  • A take with clean-up on brings its mic clip in cleaned, and the export applies the filters.
  • Screenshots of the Record tab show the round bubble and the new switches.

fmt, clippy, doc and tests pass, with new tests for: the mirror filter order, the studio's mirror in every layout, the clean-up filters and their place in the export chain, cutting preview frames, and the new ctl flags.

🤖 Generated with Claude Code

calvin-archastro and others added 2 commits October 29, 2026 09:32
…ideo

The C920 offers 30.00003 fps and refuses a frame duration of exactly 1/30,
which crashed the recorder whenever a camera was chosen; use the range's own
duration. A still (ctl frame, the viewer's freeze) dropped any video frame
lasting under half a frame, which hid the first second of every take: the
fps filter now passes the last frame, and the recorder no longer writes a
frame a few milliseconds after the one it holds at the start or a resume.
`record setup` also brings back sources that stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Look.mirror flips the picture before its crop, mask and hidden box, in the
viewer and in export alike (one hflip in the shared filters). The inspector
has it under Crop and mirror; `ctl look --mirror`. Record's scene has a
Mirror switch: the preview flips at once and a take's camera clip comes in
mirrored, while camera.mp4 stays as the camera saw it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@calvin-archastro calvin-archastro changed the title Record: fix camera takes and their first second in stills Record: camera fixes, and mirroring Oct 29, 2026
A clip's sound can be cleaned up as a voice, like OBS's mic filters:
rumble cut below 80 Hz, steady noise lowered (afftdn, its floor rising with
the strength, so a webcam's room noise drops about 5 dB at the default), and
the level evened out (dynaudnorm, which lifts quiet words without raising
the noise in pauses). One list of filters serves export and the viewer,
which decodes a cleaned clip's sound as it does a retimed one. Inspector:
Sound > Clean up the voice; ctl: `clean --clip C [--noise F] [--even]`;
Record: a switch under the mic (`record setup --clean`) so takes' mic clips
come in cleaned, the file left as recorded.

The live preview drew the camera bubble square: gpui clips to rectangles.
Camera preview frames now arrive cut to the part the scene shows, and are
drawn round themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@calvin-archastro calvin-archastro changed the title Record: camera fixes, and mirroring Record: camera fixes, mirroring, voice clean-up Oct 29, 2026
@calvin-archastro
calvin-archastro merged commit 449025e into main Oct 29, 2026
6 checks passed
@calvin-archastro
calvin-archastro deleted the record-camera branch October 29, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant