Advertisement
AyrA

GIF-high-range.bat

Jun 5th, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.65 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. REM Creates GIF files with high quality settings.
  4. REM Basically this will create a gif in the resolution and FPS of the source material.
  5. REM This file allows you to specify a range to use
  6.  
  7. SETLOCAL
  8. PUSHD "%~dp0"
  9. IF "%~1"=="" GOTO HELP
  10. SET /P FROMTIME=From (hh:mm:ss):
  11. SET /P TOTIME=Duration (hh:mm:ss):
  12.  
  13. :LOOP
  14. SET TMPPAL=%RANDOM%
  15. FFMPEG -ss %FROMTIME% -t %TOTIME% -i "%~1" -vf "palettegen" -y %TMPPAL%.PNG
  16. FFMPEG -ss %FROMTIME% -t %TOTIME% -i "%~1" -i %TMPPAL%.PNG -lavfi "paletteuse" -gifflags +transdiff -y "%~n1.gif"
  17. DEL %TMPPAL%.PNG
  18.  
  19. SHIFT
  20. IF "%~1"=="" GOTO END
  21. GOTO LOOP
  22.  
  23. :HELP
  24. ECHO Help
  25. GOTO END
  26.  
  27. :END
  28. POPD
  29. ENDLOCAL
  30. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement