Advertisement
AyrA

GIF.bat

Jun 5th, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.56 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. REM This creates GIF files with 15 fps and a width of 320 pixel. The height is auto (-1)
  4. REM change the values in the FILTER value if needed.
  5.  
  6. SETLOCAL
  7. PUSHD "%~dp0"
  8. IF "%~1"=="" GOTO HELP
  9. SET FILTER=fps=15,scale=320:-1:flags=lanczos
  10.  
  11.  
  12. :LOOP
  13. SET TMPPAL=%RANDOM%
  14. FFMPEG -i "%~1" -vf "%FILTER%,palettegen" -y %TMPPAL%.PNG
  15. FFMPEG -i "%~1" -i %TMPPAL%.PNG -lavfi "%FILTER% [x]; [x][1:v] paletteuse" -gifflags +transdiff -y "%TMPPAL%.gif"
  16. DEL %TMPPAL%.PNG
  17.  
  18. SHIFT
  19. IF "%~1"=="" GOTO END
  20. GOTO LOOP
  21.  
  22. :HELP
  23. ECHO Help
  24. GOTO END
  25.  
  26. :END
  27. POPD
  28. ENDLOCAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement