zetlnd

Untitled

Nov 19th, 2024 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. @echo off
  2. chcp 65001 > nul
  3. setlocal enabledelayedexpansion
  4.  
  5. rem Set the path to FFmpeg
  6. set "FFMPEG_PATH=I:\ffmpeg\bin\ffmpeg.exe"
  7.  
  8. rem Get the current directory where the script is located
  9. set "CURRENT_DIR=%~dp0"
  10. set "OUTPUT_FOLDER=%CURRENT_DIR%output"
  11.  
  12. rem Create output folder if it doesn't exist
  13. if not exist "!OUTPUT_FOLDER!" (
  14. mkdir "!OUTPUT_FOLDER!"
  15. )
  16.  
  17. rem Loop through all MP4 and WEBM files in the current directory
  18. for %%F in ("%CURRENT_DIR%*.mp4" "%CURRENT_DIR%*.webm") do (
  19. rem Get the filename without extension
  20. set "FILENAME=%%~nF"
  21.  
  22. rem Convert MP4 and WEBM to GIF
  23. "!FFMPEG_PATH!" -i "%%F" "!OUTPUT_FOLDER!\!FILENAME!.gif"
  24. )
  25.  
  26. echo Conversion complete!
  27. pause
  28.  
Advertisement
Add Comment
Please, Sign In to add comment