Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Created July 10, 2015 08:56
Show Gist options
  • Save EmmanuelKasper/8b00e60f9718e1d9cb2c to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/8b00e60f9718e1d9cb2c to your computer and use it in GitHub Desktop.
Create gif file with avconf
#export frames
avconv -i hatari.avi -vf fps=10 frames/ffout%03d.png
#assemble frames a gif
convert -loop 0 frames/ffout0*.png new.gif
@danijeljw
Copy link

danijeljw commented May 28, 2016

create the directory for output first
mkdir -p frames
export frames
avconv -i hatari.avi -vf fps=10 frames/ffout%03d.png
assemble frames a gif
convert -loop 0 frames/ffout0*.png new.gif

@danijeljw
Copy link

danijeljw commented May 28, 2016

You can also also change the size of the frames on export by changing the 320 in this line:
ffmpeg -i input -vf scale=320:-1:flags=lanczos,fps=10 frames/ffout%03d.png

Then use convert (or gm convert if you prefer GraphicsMagick) to make your animated GIF:
convert -loop 0 frames/ffout*.png output.gif

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