Skip to main content

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.

For windows users:
create video2gif.bat file in windows directory with these 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

And then anywhere you can use it be like this example:

video2gif myvideo.mp4

Then you have myvideo.gif in current directory.
If myvideo.gif there is existed, question from you for overwrite it.

EDIT:

I suggest use this batch script: https://github.com/NabiKAZ/video2gif

For Windows users: create a file \Windows\video2gif.bat with this 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

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.

added 89 characters in body
Source Link
Nabi K.A.Z.
  • 480
  • 1
  • 6
  • 11

For windows users:
create video2gif.bat file in windows directory with these 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

And then anywhere you can use it be like this example:

video2gif myvideo.mp4

Then you have myvideo.gif in current directory.
If myvideo.gif there is existed, question from you for overwrite it.

EDIT:

I suggest use this batch script: https://github.com/NabiKAZ/video2gif

For windows users:
create video2gif.bat file in windows directory with these 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

And then anywhere you can use it be like this example:

video2gif myvideo.mp4

Then you have myvideo.gif in current directory.
If myvideo.gif there is existed, question from you for overwrite it.

For windows users:
create video2gif.bat file in windows directory with these 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

And then anywhere you can use it be like this example:

video2gif myvideo.mp4

Then you have myvideo.gif in current directory.
If myvideo.gif there is existed, question from you for overwrite it.

EDIT:

I suggest use this batch script: https://github.com/NabiKAZ/video2gif

Source Link
Nabi K.A.Z.
  • 480
  • 1
  • 6
  • 11

For windows users:
create video2gif.bat file in windows directory with these 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

And then anywhere you can use it be like this example:

video2gif myvideo.mp4

Then you have myvideo.gif in current directory.
If myvideo.gif there is existed, question from you for overwrite it.