Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- chcp 65001 > nul
- setlocal enabledelayedexpansion
- rem Get the FFmpeg path
- set "FFMPEG_PATH=%~dp0ffmpeg.exe"
- if not exist "!FFMPEG_PATH!" (
- echo FFmpeg не найден. Скачивание...
- powershell -Command "& { (New-Object System.Net.WebClient).DownloadFile('https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip', '%~dp0ffmpeg.zip') }"
- if not exist "%~dp0ffmpeg.zip" (
- echo Не удалось скачать FFmpeg.
- pause
- exit /b
- )
- powershell -Command "& { Expand-Archive -Path '%~dp0ffmpeg.zip' -DestinationPath '%~dp0' }"
- del "%~dp0ffmpeg.zip"
- for /d %%D in ("%~dp0ffmpeg*") do move "%%D\bin\ffmpeg.exe" "%~dp0ffmpeg.exe" && rd /s /q "%%D"
- if not exist "!FFMPEG_PATH!" (
- echo FFmpeg не удалось извлечь.
- pause
- exit /b
- )
- )
- rem Check if files were dragged
- if "%~1"=="" (
- echo Перетащите файлы MP4 на скрипт для конвертации.
- pause
- exit /b
- )
- rem Create output folder
- set "OUTPUT_FOLDER=%~dp0output"
- if not exist "!OUTPUT_FOLDER!" mkdir "!OUTPUT_FOLDER!"
- rem Process each dragged file
- :loop
- if "%~1"=="" goto end
- set "INPUT_FILE=%~1"
- set "FILENAME=%~n1"
- "!FFMPEG_PATH!" -i "!INPUT_FILE!" "!OUTPUT_FOLDER!\!FILENAME!.gif"
- shift
- goto loop
- :end
- echo Конвертация завершена!
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement