Skip to content

Add high-quality GIF export support#20

Open
ax2bboud wants to merge 1 commit intoaverygan:mainfrom
ax2bboud:main
Open

Add high-quality GIF export support#20
ax2bboud wants to merge 1 commit intoaverygan:mainfrom
ax2bboud:main

Conversation

@ax2bboud
Copy link
Copy Markdown

This PR introduces the ability for users to download videos directly as optimized GIFs.

Key Changes

  • Frontend (index.html):
    • Added a new GIF toggle button to the format selection group.
    • Ensures the format parameter is correctly passed to the API during the download request.
  • Backend (app.py):
    • Implemented a new processing branch for the gif format.
    • Integrated ffmpeg for transcoding with a focus on quality and efficiency:
      • Framerate: Set to 15fps for smooth motion without excessive file size.
      • Resolution: Scaled to a maximum width of 480px (aspect-ratio preserved) to keep downloads fast.
      • Quality: Uses a two-pass filter (palettegen and paletteuse) to ensure the GIF uses an optimized color palette for better visual fidelity.
    • Automated cleanup of the intermediate MP4 file once the GIF conversion is complete.

How to Test

  1. Paste a video URL (e.g., from YouTube or TikTok).
  2. Click the GIF toggle in the format options.
  3. Click Fetch, then click Download.
  4. Verify that the resulting file is a high-quality .gif.

@ax2bboud
Copy link
Copy Markdown
Author

Ideally, you'd want people to choose quality and fps options but it would take away from the simplicity of the tool.

DeBondor added a commit to DeBondor/reclip that referenced this pull request Apr 11, 2026
…an#14 — cookies, playlist, AAC, GIF, batch download

- averygan#25: cookies.txt support (COOKIES_FILE auto-detected, passed to all yt-dlp calls)
- averygan#28: YouTube playlist expansion via /api/playlist endpoint (flat-playlist -J)
- averygan#29: Force AAC audio codec (-S acodec:aac) for all video/audio downloads
- averygan#20: GIF export via ffmpeg 2-pass palettegen/paletteuse, 15fps, max 480px width
- averygan#14: Batch download via /api/batch/download + /api/batch/status, ThreadPoolExecutor(3), parallel Download All
@ax2bboud ax2bboud closed this Apr 17, 2026
@ax2bboud ax2bboud reopened this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant