Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- ECHO This is a simple MP4 to GIF utility. Please follow the instructions.
- ECHO.
- ECHO Please ensure you have FFMPEG installed somewhere. In fact, let's point to that now.
- set /p ffmpeg=FFMPEG binary [File path]:
- ECHO.
- ECHO Ok, cool. Now we will make an input and output folder.
- ECHO.
- mkdir input
- mkdir output
- ECHO.
- ECHO Please place a file named "in.mp4" into the input folder and
- pause
- ECHO.
- ECHO Let's set some basic parameters.
- ECHO.
- set /p ssparam=Start time in video[seconds]:
- set /p tparam=Length[seconds]:
- set /p scaleparm=Width[pixels]:
- set /p fpsparm=Target FPS:
- %ffmpeg% -y -ss %ssparam% -t %tparam% -i input/in.mp4 -vf fps=%fpsparm%,scale=%scaleparm%:-1:flags=lanczos,palettegen input/palette.png
- ECHO Palette generation complete.
- ECHO.
- pause
- %ffmpeg% -ss %ssparam% -t %tparam% -i input/in.mp4 -i input/palette.png -filter_complex "fps=%fpsparm%,scale=%scaleparm%:-1:flags=lanczos[x];[x][1:v]paletteuse" output/out.gif
- ECHO.
- ECHO.
- ECHO That's finished. Your result can be found in the output folder.
- ECHO If your output is empty, something went wrong.
- pause
Add Comment
Please, Sign In to add comment