Skip to content

feat: add pipeline to run several edits as one ffmpeg process (#125) - #162

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/pipeline-125
Oct 25, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
feat/pipeline-125

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #125.

pipeline { input, steps, quality?, dryRun?, output? } runs a chain of edits as one ffmpeg process: one re-encode instead of one per edit, and no intermediate files. Steps take the same options as their tools: trim, crop, scale, speed, redact, callout, reframe, zoom (keyframes). export_preset or export_gif may come last.

How it fuses

  • Each step adds filter-graph steps over the current video label, built by the same helpers as the standalone tools. I factored cropFilter, scaleFilter, redactSteps, calloutSteps, zoomFilter, and exportPresetParts out of the builders, and moved callout asset prep and the GIF size ladder into utils. The standalone tools' output is unchanged; existing tests pin it.
  • Frame size, fps, and duration are tracked through the chain. Each step is validated against the frame it receives (e.g. a crop after a scale), and times in a step are on the timeline at that step.
  • A leading trim is an input seek; later trims use trim/atrim. Audio follows trims and speed changes, and is copied untouched when nothing changes timing. Labels are namespaced per step, so repeated ops don't collide.
  • An export_gif tail is the one two-stage case: a high-quality mp4, then the size-budget ladder.
  • dryRun returns what each step became and the fused ffmpeg command.

Done-when check (integration, real ffmpeg, runs on CI): trim → crop → scale → export_preset runs as one process with a single -i. It matches the four tools run one by one: same 1080×1080 size, same duration, SSIM > 0.95. A second test fuses speed + redact + callout (duration halves, redaction and callout drawn) and ends in a GIF.

End to end through the built server: the REC 01 bug-repro chain (redact → trim → callout → GIF) as one pipeline call took 368 ms, with progress reported, and produced the same GIF. It's now docs recipe REC 07, "The whole edit in one call".

Bumps to 0.30.0.

🤖 Generated with Claude Code

Steps (trim, crop, scale, speed, redact, callout, reframe, zoom, then an
optional export_preset or export_gif) take their tools' options and are
fused into one filter graph, with frame size, fps, and duration tracked
through the chain. Builders expose their filter fragments so the tools
and pipeline share one implementation. Docs recipe REC 07.

Closes #125

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 25, 2026
@TMHSDigital
TMHSDigital merged commit e1363d7 into main Oct 25, 2026
8 checks passed
@TMHSDigital
TMHSDigital deleted the feat/pipeline-125 branch October 25, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pipeline tool: chain several edits in one call with no intermediate files

1 participant