mirror of
https://github.com/software-mansion/argent.git
synced 2026-09-14 19:27:14 +08:00
4621fe55f6
`simctl io recordVideo` and `adb screenrecord` both emit VARIABLE-framerate
video — frames land only when the screen changes, so static spans collapse and
the irregular timestamps stutter on playback (this, plus over-compression, was
the "laggy" capture). Neither path uses the simulator-server. On stop the raw
capture now runs one ffmpeg finishing pass that:
- normalizes to a constant 30fps (smooth playback everywhere), and
- overlays a corner watermark — for now a translucent placeholder square,
bottom-left, standing in for assets/watermark.svg ("Argent / By @swmansion")
until the artwork is final.
The pass is best-effort: if ffmpeg is missing or fails, the raw capture is
returned untouched with a warning, so a recording is never lost. The watermark
is on by default and disableable with `argent disable video-watermark`
(re-enable with `argent enable video-watermark`); 30fps normalization always
applies when ffmpeg is present. The flag is read live per stop, so toggling it
takes effect without restarting the tool-server.
Supporting the opt-out flag needed the flag system to learn about default-ON
flags: FlagDefinition gains `defaultEnabled`, a registry-aware `isFeatureEnabled`
resolves an unset flag to its declared default, and `argent disable` persists an
explicit `false` for such a flag (an unset would revert it to its ON default).
Opt-in flags are unchanged (no `defaultEnabled` -> same enable/disable behavior).
Tests: opt-out flag semantics (core + CLI, incl. `argent disable video-watermark`
writes false), the 30fps/watermark filter chain, and the shipped registry entry.
E2E on an iOS sim: default -> constant 30fps + watermark; flag off -> 30fps,
no watermark.