Thursday, February 12, 2015

Convert video to gif with ffmpeg


ffmpeg -i input.mkv -vf scale=1024:-1 -t 20 -r 20 output.gif

-vf scale=1024:01 : output file width
-t 20 : set output to 20 seconds
-r 20 : set frame rate of 20 fps

Example:

ffmpeg -i \[Kamigami\]\ Puella\ Magi\ Madoka\ Magica\ -\ 03\ \[BD\ 1920×1080\ x264\ Hi10P\ FLAC\(Jap\,Eng\,Ita\)\ Sub\(GB\,Big5\,Jap\,Eng\)\].mkv -vf scale=1024:-1 -t 20 -r 30 output.gif


https://i.imgur.com/DR0YYH1.gif






Reference: