Skip to content

pipeline writes a re-renderable edit spec (.edit.json) and accepts fromEdit #340

Closed

Description

@TMHSDigital

Summary

Make edits re-renderable. Each pipeline run writes a small <output>.edit.json (source path, steps, recipe, tool version, source hash). A later pipeline { fromEdit: "<file>.edit.json", override: {...} } re-renders from the raw recording with tweaks, so "make the zoom gentler" or "now export a 9:16 version" doesn't stack another lossy encode on top of the last output.

Where

  • src/tools/pipeline.ts:315-380: pipeline writes SRT and chapter sidecars, but not the edit spec that produced the output.
  • src/utils/recipes.ts: recipes (pr_demo, tutorial, social_reel) are already plain step lists, so the spec is easy to serialise.

Details

Today iterating on an edit means either recomputing the steps by hand or re-editing the already-encoded output, losing quality each round. The edit is also not reproducible: given a polished clip, nobody can tell which redactions or trims were applied, which matters when a redaction must be audited before sharing.

Suggested fix

  1. After a successful (non-dry) run, write <output>.edit.json with { version, source, sourceSize, sourceMtime, recipe?, steps, output }.
  2. pipeline { fromEdit, override?: { steps patch by index or op name }, output? } loads the spec, checks the source still matches, applies overrides, and renders from the source.
  3. get_media_info (or the review player) shows "edited from X with N steps" when a spec is present.
  4. Retention prunes the sidecar with the output.

Acceptance criteria

  • Every pipeline output has an edit spec; dry runs don't write one
  • fromEdit reproduces an identical step list, and overrides change only what they name
  • Missing or changed source gives a clear error
  • Redaction steps are visible in the spec for audit

Getting started

  • Relevant files: src/tools/pipeline.ts, src/utils/pipeline.ts, src/utils/recipes.ts
  • Tests: npm test

Filed by repo-audit/feature-ideas at 19569f7. Severity: medium. Effort: M. audit-key: enhancement|src/tools/pipeline.ts|editSpec

Activity

  1. added
    enhancement
    help wanted
    effort: medium
    on Nov 15, 2026
  2. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    Done in 990f85b: each pipeline result gets .edit.json (source size and mtime, expanded steps, recipe, quality, chapters), returned as editSpecPath. pipeline { fromEdit } re-renders from the original source, steps override same-op steps like a recipe, and a changed or missing source is refused. Verified with pure tests and a real-ffmpeg integration case (write, re-render with a new scale, refuse after the source changes); full suite passes. get_media_info/player display of the spec was not added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: mediumenhancementhelp wantedpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions