Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- chcp 65001 > nul
- setlocal enabledelayedexpansion
- rem Set the path to FFmpeg
- set "FFMPEG_PATH=I:\ffmpeg\bin\ffmpeg.exe"
- rem Get the current directory where the script is located
- set "CURRENT_DIR=%~dp0"
- set "OUTPUT_FOLDER=%CURRENT_DIR%output"
- rem Create output folder if it doesn't exist
- if not exist "!OUTPUT_FOLDER!" (
- mkdir "!OUTPUT_FOLDER!"
- )
- rem Loop through all MP4 and WEBM files in the current directory
- for %%F in ("%CURRENT_DIR%*.mp4" "%CURRENT_DIR%*.webm") do (
- rem Get the filename without extension
- set "FILENAME=%%~nF"
- rem Convert MP4 and WEBM to GIF
- "!FFMPEG_PATH!" -i "%%F" "!OUTPUT_FOLDER!\!FILENAME!.gif"
- )
- echo Conversion complete!
- pause
Advertisement
Add Comment
Please, Sign In to add comment