Guest User

Untitled

a guest
May 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. @ECHO OFF
  2. ECHO This is a simple MP4 to GIF utility. Please follow the instructions.
  3. ECHO.
  4. ECHO Please ensure you have FFMPEG installed somewhere. In fact, let's point to that now.
  5. set /p ffmpeg=FFMPEG binary [File path]:
  6. ECHO.
  7. ECHO Ok, cool. Now we will make an input and output folder.
  8. ECHO.
  9. mkdir input
  10. mkdir output
  11. ECHO.
  12. ECHO Please place a file named "in.mp4" into the input folder and
  13. pause
  14. ECHO.
  15. ECHO Let's set some basic parameters.
  16. ECHO.
  17. set /p ssparam=Start time in video[seconds]:
  18. set /p tparam=Length[seconds]:
  19. set /p scaleparm=Width[pixels]:
  20. set /p fpsparm=Target FPS:
  21.  
  22. %ffmpeg% -y -ss %ssparam% -t %tparam% -i input/in.mp4 -vf fps=%fpsparm%,scale=%scaleparm%:-1:flags=lanczos,palettegen input/palette.png
  23. ECHO Palette generation complete.
  24. ECHO.
  25. pause
  26. %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
  27. ECHO.
  28. ECHO.
  29. ECHO That's finished. Your result can be found in the output folder.
  30. ECHO If your output is empty, something went wrong.
  31. pause
Add Comment
Please, Sign In to add comment