Quantcast
Channel: How do I convert a video to GIF using ffmpeg, with reasonable quality? - Super User
Viewing all articles
Browse latest Browse all 19

Answer by Nabi K.A.Z. for How do I convert a video to GIF using ffmpeg, with reasonable quality?

$
0
0

For Windows users: create a file \Windows\video2gif.bat with this content:

@echo offset arg1=%1set arg2=%arg1:~0,-4%ffmpeg -y -i %arg1% -vf fps=10,scale=-1:-1:flags=lanczos,palettegen %TEMP%\palette.pngffmpeg -i %arg1% -i %TEMP%\palette.png -filter_complex "fps=10,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" %arg2%.gifdel /f %TEMP%\palette.png

And then you can use it anywhere like this:

video2gif myvideo.mp4

Then you have myvideo.gif next to your original input file. If myvideo.gif already exists, you will be asked to overwrite it.

I suggest using this versatile batch script.


Viewing all articles
Browse latest Browse all 19

Trending Articles