Skip to content

Instantly share code, notes, and snippets.

@lidio601
Last active May 20, 2016 09:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lidio601/c318235d7d127c1c2026a74bd1a0db2a to your computer and use it in GitHub Desktop.
Video2GIF Convert a video file (maybe a ScreenCast) to a GIF - I usually use QuickCast to output an MP4 video file, then convert it into a GIF
#!/bin/bash
IN="quickcast.mp4"
OUT="output.gif"
# INPUT FILE: quickcast.mp4
# OUTPUT FILE: output.gif
ffmpeg -y -i $IN -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
ffmpeg -i $IN -i palette.png -filter_complex "fps=5,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y $OUT
ffmpeg -t 20 -i $IN -i palette.png -filter_complex "fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y $OUT
# ffmpeg -t 20 -i $IN -i palette.png -filter_complex "crop=0:0:0:0,fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y $OUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment