Advertisement
metalx1000

Convert Video to Animated GIF

Nov 9th, 2017
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
  2. #http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
  3. ###########FFMPEG OPTION###############
  4. #Generate a palette:
  5. ffmpeg -y -ss 30 -t 3 -i input.flv -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
  6.  
  7. #Output the GIF using the palette:
  8. ffmpeg -ss 30 -t 3 -i input.flv -i palette.png -filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
  9.  
  10. #########Image Magick Option###########
  11. #Export frames:
  12. mkdir frames
  13. ffmpeg -i input -vf scale=320:-1:flags=lanczos,fps=10 frames/ffout%03d.png
  14.  
  15. #Then use convert (or gm convert if you prefer GraphicsMagick) to make your animated GIF:
  16. convert -loop 0 frames/ffout*.png output.gif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement