Skip to content

feat: canvas-based live preview — show crop/rotation/color changes instantly #653

@magic-peach

Description

@magic-peach

Currently there is no visual feedback when the user changes framing, rotation, brightness, contrast, or saturation — the only way to see the result is to run a full FFmpeg export. This makes iteration extremely slow.

What to build

Add a canvas-based live preview that updates instantly as the user changes settings:

  • Use the HTML5 <video> element as the source and draw frames onto a <canvas> using ctx.drawImage()
  • Apply CSS filters (brightness(), contrast(), saturate()) to the canvas for color adjustment preview
  • Apply CSS transform: rotate() for rotation preview
  • Apply canvas clip/letterbox logic to preview the selected aspect ratio / framing (fit vs fill)
  • The preview should update on every requestAnimationFrame while the video is paused, and continuously while playing

Files to modify

  • src/components/VideoPreview.tsx — replace or augment the <video> element with a <canvas> overlay
  • src/hooks/useVideoEditor.ts — pass the current recipe to the preview component

Acceptance criteria

  • Rotation changes (0/90/180/270°) are reflected in the preview without exporting
  • Brightness / contrast / saturation sliders update the preview in real time
  • The aspect ratio framing (fit/fill) is visually indicated in the preview
  • Performance: no layout thrashing; use requestAnimationFrame
  • The export result still uses FFmpeg (the canvas is preview-only)

Screen Recording Required

Your PR for this issue must include a screen recording showing the feature working on your local machine (bun run devhttp://localhost:3000). PRs without a recording will not be merged.

See CONTRIBUTING.md for how to record.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions