feat: demo post-processing — webm→H.264 mp4 (+faststart) and trim (v1.2.0)#6
Merged
Conversation
….2.0)
SNS uploaders want mp4, not Playwright's vp8 webm. New src/video.js: findFfmpeg (SHOTKIT_FFMPEG → PATH; Playwright's bundled ffmpeg is vp8-only — verified empirically, no libx264), buildFfmpegArgs (pure, unit-tested), postProcessDemo (mp4 with optional frame-accurate trim; trim-only = in-place stream-copy). Wired into capture() after saveAs; CLI --mp4; config demo.mp4 (true|{crf}) + demo.trim {start,duration}. Fails loudly with an install hint if requested without ffmpeg — never silently skips. Verified end-to-end with real ffmpeg: h264 1280x800, moov-before-mdat (faststart), 5.48s→2.000s trim. 35 unit tests green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the roadmap's video-editing item (mp4 + trim; captions stay planned):
src/video.js—findFfmpeg(SHOTKIT_FFMPEG→ PATH; Playwright's bundled ffmpeg is vp8-only, verified empirically), purebuildFfmpegArgs,postProcessDemo(mp4 w/ optional frame-accurate trim; trim-only = in-place stream-copy).--mp4; configdemo.mp4: true|{crf},demo.trim: {start, duration}. Requested-but-missing ffmpeg fails loudly with an install hint (GH ubuntu runners ship ffmpeg → the capture-in-CI path emits mp4 out of the box).+faststart), silent track, 5.48s→2.000s trim. Unit tests for args/discovery; lint green.