Skip to content

feat(desktop): live ffmpeg encoder progress events for long video exports #76

Description

@huntharo

Summary

Stream progress updates from the ffmpeg encoder to the renderer over EVENT_CHANNELS.renderProgress so users get a progress bar / percentage on long GIF or MP4 exports instead of a spinner of unknown duration.

Listed in PR #66's notable follow-ups; not addressed in the merged scope.

Current state

recording-exporter.ts:185 runFfmpeg shells out and awaits exit. No stderr parsing, no incremental updates. The renderer shows the export button in a generic "Encoding…" state with no indication of how far along it is.

Short clips finish before the user notices; long ones (30s+ GIF with palettegen, or a multi-minute MP4 export) leave the user wondering whether anything's happening.

Scope

  • Parse ffmpeg's stderr time= / out_time_ms= lines (or use -progress pipe:1 for cleaner machine-readable output).
  • Compute a percentage against the known input duration (we have it from video_captures.duration_sec).
  • Emit renderProgress events on a throttled cadence (e.g. every 250ms).
  • Renderer's export button state in FloatOver.tsx shows a percentage / progress ring instead of just "Encoding…".
  • Make sure progress events don't survive the export — clear them in done / error final states.

Out of scope

  • Pause/cancel of in-flight exports. Different problem (need to manage the child process lifecycle and handle partial output).
  • Multi-step pipelines (e.g. GIF's palettegen → paletteuse). Report combined progress as best-effort; a coarse two-phase split is fine.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions