Skip to content

Implement GIF encoding with ffmpeg #9

@grovecj

Description

@grovecj

Description

Convert recorded video frames to an optimized GIF using bundled ffmpeg.

Tasks

  • Bundle ffmpeg binary for Windows and macOS
  • Use ffmpeg-static or similar npm package
  • Generate color palette for optimal GIF quality
  • Encode frames to GIF with configurable quality
  • Show encoding progress indicator
  • Optimize file size while maintaining quality
  • Handle encoding errors gracefully
  • Clean up temporary files after encoding

ffmpeg Pipeline

# Step 1: Generate palette
ffmpeg -i input.mp4 -vf "palettegen" palette.png

# Step 2: Create GIF with palette
ffmpeg -i input.mp4 -i palette.png -lavfi "paletteuse" output.gif

Configuration

{
  "encoding": {
    "quality": "high",
    "colors": 256,
    "dither": true
  }
}

Acceptance Criteria

  • GIFs are high quality with reasonable file size
  • Encoding completes within reasonable time
  • Progress is shown to user

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions