Repository navigation
fix(engine): nested video clips on a frame boundary export every source frame - #6893
Conversation
There was a problem hiding this comment.
Verdict: APPROVE · 0 blockers · 0 important · 1 nit
No blocker at 1b30bf79. The root cause holds up. A shift under 1e-9 now snaps start onto the frame and leaves mediaStart alone, so float dust no longer reaches it. formatFfmpegSeconds only rewrites values that String() would print with an exponent.
Nit, follow-up: some ffmpeg time arguments outside the engine still use String(). In the export path these are producer/.../captureHdrResources.ts:386 and :496 (the -ss from mediaStart/ffmpegSeek) and producer/.../audioTruePeak.ts:50. There are more in studio-server (proxyTranscoder, loudness) and in the CLI's measure/snapshot commands. Now that mediaStart no longer picks up dust, they are not on this bug's path, but a later tiny value would hit the same Invalid duration specification there. formatFfmpegSeconds is exported, so they could switch over in a follow-up.
What I checked
- The local ffmpeg rejects
-ss 8.88e-16("Invalid duration specification for ss"), which confirms the failure mode. The formatter maps ±8.88e-16, 5e-7 and 1e-7 to0(negative values give0, not-0) and keeps1.35and4.666666666666666unchanged. ffprobe.test.tsandvideoFrameExtractor.test.ts: with main's source and the PR's tests, the 3 new tests fail (exponent, ordinary times, nested clip on a frame boundary). At head they pass. In both runs, 4 HDR-PNG cICP and stream-classification tests also fail in my sandbox, on main as well, so I put those down to my local ffprobe/fixtures, not this PR.- A grep of
engine/srcfinds no remainingString()/template time values for-ss,-tor-read_intervals. - At review time CI, regression, CodeQL and Windows render verification were still running on this head; the other workflows were green.
Edit accuracy: accurate 271 (base branch 271), smooth 119 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
What
A nested video clip whose start sums to a frame boundary (for example parent 3.3 s + local 1.3666666666666667 s at 30 fps) now exports with every source frame instead of aborting.
Why
alignClipStartToFirstOutputFramesaw a start of 4.666666666666666 (frame 140, already on the grid) and still shiftedmediaStartby 8.88e-16. That value reached ffmpeg/ffprobe in scientific notation, which their parsers reject, and the clip lost frames (7 of 8 captured, below the 95% coverage threshold).How
mediaStartis untouched. Real shifts (for example a start of 1.999999) still movemediaStart.formatFfmpegSecondsinutils/ffprobe.tsis the one formatter for-ss,-tand-read_intervalsvalues (extractor, audio mixer, ffprobe helpers). Ordinary times print exactly as before; only exponent forms are rewritten to fixed notation.Test plan
ffprobe.test.tsandvideoFrameExtractor.test.ts: 350 passed, 3 runs in a row on the devbox.expected 1.350000000000001 to be 1.35; the formatter tests fail (formatFfmpegSeconds is not a function).Size
Standalone: one root cause and its single formatter; splitting would leave the exponent path or the dust source open.