fix(recording): render the touch overlay at most 30 fps and inside the record request

Merged
HA
2mo ago
+134-19

Summary

record stop with touches took about 0.4 s per second of recording, outlasting record's 90 s request past about 3.5 minutes. Closes #3218. Five files:

  • Swift: the composition renders at most 30 fps. It used the capture's minFrameDuration, one timescale tick (1/600 s from simctl): 75 fps on the simulator, three times the frames captured. A capture reporting none renders at 30. The export wait takes a timeout.
  • overlay.ts: the overlay gets 70 s for compile, export and exit; the export gets what is left less 5 s, as --timeout-ms (both caps were 120 s). Past it the stop returns the raw video with overlayWarning, inside the request.

The export keeps the capture's resolution (#2707).

Validation

At ea2a631: pnpm check:affected --run passed (format, lint, typecheck, layering, fallow, build, 1,733 related tests, packaged runner Swift). Two new overlay.test.ts cases fail without the change; the root envelope check, which keeps 20 s of record's envelope outside the budget, fails with a 71 s one.

iPhone 16 simulator, record stop in seconds:

RecordingBeforeAfter
30 s13.86.3
2 min48.619.9
5 min90.2, timed out47.8
10 min66.5: export cut at its budget; raw video with overlayWarning, no helper or temp file left

Emulator, 2 min: 48.3 → 18.8. The 10-minute row ran on b50f71a06; the others ran this change on npm 0.21.20.

Not run locally: Swift runner builds and device lanes.