Skip to content

Instantly share code, notes, and snippets.

@gitfvb
Created October 21, 2025 07:50
Show Gist options
  • Select an option

  • Save gitfvb/13932e8491d4c3f40b84ef352d52013d to your computer and use it in GitHub Desktop.

Select an option

Save gitfvb/13932e8491d4c3f40b84ef352d52013d to your computer and use it in GitHub Desktop.
Create high quality gifs from MP4 video
PS C:\Users\flo\Downloads\ffmpeg-n8.0-latest-winarm64-gpl-8.0\bin> .\ffmpeg.exe -i "C:\Users\flo\Downloads\win\video.mp4" -vf "fps=15,scale=1024:-1:flags=lanczos,palettegen" palette.png
  • Convert the mp4 file with the palette.png into a gif
.\ffmpeg.exe -i "C:\Users\flo\Downloads\win\video.mp4" -i palette.png -filter_complex "fps=15,scale=1024:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif

The most important parameters are fps and scale

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