Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- REM Creates GIF files with high quality settings.
- REM Basically this will create a gif in the resolution and FPS of the source material.
- REM This file allows you to specify a range to use
- SETLOCAL
- PUSHD "%~dp0"
- IF "%~1"=="" GOTO HELP
- SET /P FROMTIME=From (hh:mm:ss):
- SET /P TOTIME=Duration (hh:mm:ss):
- :LOOP
- SET TMPPAL=%RANDOM%
- FFMPEG -ss %FROMTIME% -t %TOTIME% -i "%~1" -vf "palettegen" -y %TMPPAL%.PNG
- FFMPEG -ss %FROMTIME% -t %TOTIME% -i "%~1" -i %TMPPAL%.PNG -lavfi "paletteuse" -gifflags +transdiff -y "%~n1.gif"
- DEL %TMPPAL%.PNG
- SHIFT
- IF "%~1"=="" GOTO END
- GOTO LOOP
- :HELP
- ECHO Help
- GOTO END
- :END
- POPD
- ENDLOCAL
- PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement