For windowsWindows users:
create create a file video2gif\Windows\video2gif.bat
file in windows directory with thesethis content:
@echo off
set arg1=%1
set arg2=%arg1:~0,-4%
ffmpeg -y -i %arg1% -vf fps=10,scale=-1:-1:flags=lanczos,palettegen %TEMP%\palette.png
ffmpeg -i %arg1% -i %TEMP%\palette.png -filter_complex "fps=10,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" %arg2%.gif
del /f %TEMP%\palette.png
@echo off
set arg1=%1
set arg2=%arg1:~0,-4%
ffmpeg -y -i %arg1% -vf fps=10,scale=-1:-1:flags=lanczos,palettegen %TEMP%\palette.png
ffmpeg -i %arg1% -i %TEMP%\palette.png -filter_complex "fps=10,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" %arg2%.gif
del /f %TEMP%\palette.png
And then anywhere you can use it beanywhere like this example:
video2gif myvideo.mp4
video2gif myvideo.mp4
Then you have myvideo.gif
in current directorynext to your original input file.
If If myvideo.gif
there is existedalready exists, question from you forwill be asked to overwrite it.
EDIT:
I suggest use this batch script: https://github.com/NabiKAZ/video2gifusing this versatile batch script.