Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- REM This creates GIF files with 15 fps and a width of 320 pixel. The height is auto (-1)
- REM change the values in the FILTER value if needed.
- SETLOCAL
- PUSHD "%~dp0"
- IF "%~1"=="" GOTO HELP
- SET FILTER=fps=15,scale=320:-1:flags=lanczos
- :LOOP
- SET TMPPAL=%RANDOM%
- FFMPEG -i "%~1" -vf "%FILTER%,palettegen" -y %TMPPAL%.PNG
- FFMPEG -i "%~1" -i %TMPPAL%.PNG -lavfi "%FILTER% [x]; [x][1:v] paletteuse" -gifflags +transdiff -y "%TMPPAL%.gif"
- DEL %TMPPAL%.PNG
- SHIFT
- IF "%~1"=="" GOTO END
- GOTO LOOP
- :HELP
- ECHO Help
- GOTO END
- :END
- POPD
- ENDLOCAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement