Make gif, quick guide, convert and ffmpeg with palette

Channel:
Subscribers:
218
Published on ● Video Link: https://www.youtube.com/watch?v=CdkEJyHQy5Y



Category:
Guide
Duration: 15:39
385 views
2


ffmpeg https://www.ffmpeg.org/download.html
convert (ImageMagick) http://www.imagemagick.org/script/bin...

Result: http://hnng.moe/f/95d (convert, ffmpeg is less good)

Commands:
Make image sequence
ffmpeg -i i.mkv -an -f image2 "o_%05d.png"
Image sequence to video (back procedure)
ffmpeg -start_number 10 -i o_%05d.png -vcodec mpeg4 o.mp4
Scaling video
ffmpeg -i i.mkv -vf scale=640:360 o.mkv
Crop video. First time is start, second is delay
ffmpeg -y -i i.mkv -vcodec copy -acodec copy -ss 00:00:00 -t 00:00:01 -sn o.mkv
Generate palette
ffmpeg -i i.mkv -vf palettegen palette.png
Make gif (from ffmpeg+palette)
ffmpeg -v warning -i i.mkv -i palette.png -lavfi "fps=15,scale=320:-1:flags=lanczos [x]; [x][1:v] paletteuse" -y a.gif
ffmpeg -v warning -i o.mkv -i palette.png -lavfi "fps=23,scale=540:-1:flags=lanczos [x]; [x][1:v] paletteuse" -y a.gif
Make gif from image sequence
convert -delay 4 -loop 0 *.png a.gif

For size optimization you may skip some frames, i.e. no need to make full 30 fps gif, for example 25 or 24 or 20. For this add flag, where you extracted image sequence (3:23) -vf fps=1/60 where 1/60 = 60fps or at 13:37 change fps parameter.

P.S. this is my methods how to do it, it simply by me, but you need to know that it is no only possible methods, you can do it by other way. But be sure, without good palette gif will looks like ugly! (also long gif with or without palette)







Tags:
ffmpeg
convert
imagemagic
gif
make
create
colors