Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- powershell -Command "(Get-Content '%~f0') -join \"`r`n\" | Set-Content '%~f0'"
- more +3 "%~f0" > "ffmpeg_temp.txt"
- move /y "ffmpeg_temp.txt" "%~f0" && del ffmpeg_temp.txt && exit
- :full
- echo off
- chcp 65001
- SETLOCAL EnableDelayedExpansion
- cls
- set input=
- set o=
- title Improved FFMPEG
- if exist "ffmpeg.exe" (
- goto ready
- ) else (
- echo ffmpeg.EXE not found. Move this file to folder with FFMPEG for work.
- echo Press any key to close.
- pause > nul
- exit
- )
- :ready
- echo.
- set pro=
- set /p pro=Enter pro-mode? (1 - yes, else - no):
- if "!pro!"=="1" goto pro
- :input
- cls
- echo Ver 1.6 - thewho.narod.ws
- echo.
- title FFMPEG - Simple mode
- echo ████ ████ ██ ██ ████ ████ █████
- echo █ █ █ █ █ █ █ █ █ █
- echo ████ ████ █ █ █ ████ ████ █ ██
- echo █ █ █ █ █ █ █ █
- echo █ █ █ █ █ ████ █████
- echo.
- echo Remain empty to not change (when re-entering the parameters, everything except
- Input and output video names are reset). Include file extensions in names.
- echo Leave the input/output file field blank or enter 0 to output presets
- echo When going to presets, the input/output file names are reset.
- echo To display all codecs and formats, go to presets.
- echo.
- set ar= -ar
- set format= -format
- set vcodec= -vcodec
- set b= -b:v
- set s= -s
- set r= -r
- set acodec= -acodec
- set ab= -b:a
- :inputset
- set /p input=Input file:
- if "!input!"=="" goto presets
- if !input!==0 goto presets
- if not exist !input! echo Input file !input! not found. && set /p input=Input file:
- if "!input!"=="" goto presets
- if !input!==0 goto presets
- if not exist !input! echo Input file !input! still not found, let's continue.
- :oset
- set /p o=Output file:
- if "!o!"=="" goto presets
- if !o!==0 goto presets
- if exist !o! echo File !o! is found, it will be automatically rewrited.
- set /p format1=Format:
- if "!format1!"=="" set format=
- set /p vcodec1=Video codec:
- if "!vcodec1!"=="" set vcodec=
- set /p b1=Video bitrate:
- if "!b1!"=="" set b=
- set /p s1=Video resolution:
- if "!s1!"=="" set s=
- set /p r1=Video frame-rate (FPS):
- if "!r1!"=="" set r=
- set /p acodec1=Audio codec:
- if "!acodec1!"=="" set acodec=
- set /p ab1=Audio bitrate:
- if "!ab1!"=="" set ab=
- set /p ar1=Audio sample-rate:
- if "!ar1!"=="" set ar=
- set /p log=Enable logging? (1 - yes, else - no):
- set format=!format!!format1!
- set vcodec=!vcodec!!vcodec1!
- set b=!b!!b1!
- set s=!s!!s1!
- set r=!r!!r1!
- set acodec=!acodec!!acodec1!
- set ab=!ab!!ab1!
- set ar=!ar!!ar1!
- echo.
- echo Everything is ready. Press any button to convert !input!.
- pause > nul
- cls
- if "!log!"=="1" (
- title FFMPEG - Working
- echo.
- echo Processing...
- >>iFFMPEG_logs.txt 2>&1(
- echo.
- echo ================ %date% %time% ================
- echo Arguments: -i !input!!format!!vcodec!!acodec!!b!!r!!ab!!ar! -y!s! -title X !o!
- ffmpeg.exe -i !input!!format!!vcodec!!acodec!!b!!r!!ab!!ar! -y!s! -title X !o!
- echo.
- echo Errorlevel = !errorlevel!
- )
- if "!errorlevel!"=="0" (
- cls
- echo.
- title FFMPEG - !o! ready
- echo Your file !o! is ready.
- ) else (
- echo.
- title FFMPEG - Error
- echo FFMPEG got error.
- )
- ) else (
- title FFMPEG - Working
- ffmpeg.exe -i !input! !format! !vcodec! !acodec! !b! !r! !ab! !ar! -y !s! -title X !o!
- if "!errorlevel!"=="0" (
- cls
- echo.
- title FFMPEG - !o! ready
- echo Your file !o! is ready.
- ) else (
- echo.
- title FFMPEG - Error
- echo FFMPEG got error.
- )
- )
- echo.
- echo 1. Retry
- echo 2. Change set-ups
- echo 3. Restart program
- echo 0. Open output folder
- echo.
- if "!log!"=="1" echo Logs saved in iFFMPEG_logs.txt in program folder.
- set /p func="Enter command above, blank to exit: "
- if "!func!"=="1" goto convert
- if "!func!"=="2" goto input
- if "!func!"=="3" goto full
- if "!func!"=="0" (
- for %%i in ("!o!") do set "o_p=%%~dpi"
- start !o_p!
- goto end11
- )
- exit
- :presets
- set input=
- set o=
- set preset=
- cls
- title FFMPEG - Presets
- echo.
- echo Presets:
- echo 1. Get file info
- echo 2. Convert to MP3 (extension automatically is .MP3)
- echo 3. DVD player friendly format (extension automatically is .MPG)
- echo 4. Old phones frienly format (4:3)
- echo 5. Вывод кодеков
- echo 6. Вывод форматов
- :presetset
- echo.
- set /p preset=Preset, blank to return to simple mode:
- if "!preset!"=="" goto input
- :presetinput
- if "!preset!"=="5" goto convert1
- if "!preset!"=="6" goto convert1
- set /p input=Input file:
- if "!input!"=="" cls and goto presetinput
- if "!preset!"=="1" goto convert1
- :presetoutput
- set /p o=Output file:
- if "!o!"=="" cls and goto presetoutput
- echo Everything is ready. Press any key to convert !input!.
- if exist "!o!" (
- echo File !o! is found, it will be automatically rewrited.
- )
- pause > nul
- :convert1
- :: getinfo/preset 1
- if "!preset!"=="1" ffmpeg -i !input!
- :: preset 2
- if "!preset!"=="2" (
- set o=!o!.mp3
- ffmpeg -i !input! -vn -y -f mp3 !o!
- )
- :: preset 3
- if "!preset!"=="3" (
- set o=!o!.mpg
- ffmpeg -i !input! -c:v mpeg2video -qscale:v 2 -maxrate:v 4000k -bufsize:v 2000k -s 640x480 -r 25 -c:a mp2 -b:a 192k -ac 2 !o!
- )
- :: preset 4
- if "!preset!"=="4" ffmpeg -i !input! -vcodec mpeg4 -b:v 250000 -b:a 64 -s 192x144 -acodec aac -y -ar 24000 !o!
- :: preset 5
- if "!preset!"=="5" ffmpeg -encoders
- :: preset 6
- if "!preset!"=="6" ffmpeg -formats
- if "!preset!"=="1" echo Command processed && goto end11
- if "!preset!"=="5" echo Command processed && goto end11
- if "!preset!"=="6" echo Command processed && goto end11
- if "!errorlevel!"=="0" (
- cls
- echo.
- title FFMPEG - !o! ready
- echo Your file !o! is ready.
- ) else (
- echo.
- title FFMPEG - Error
- echo FFMPEG got error
- )
- :end11
- echo.
- set func=0
- echo 1. Retry
- echo 2. Change preset
- echo 3. Restart program
- echo 0. Open output folder
- set /p func="Enter command above, blank to exit: "
- if "!func!"=="1" goto convert1
- if "!func!"=="2" goto presets
- if "!func!"=="3" goto full
- if "!func!"=="0" (
- for %%i in ("!o!") do set "o_p=%%~dpi"
- start !o_p!
- goto end11
- )
- exit
- :pro
- cls
- title FFMPEG - Pro-mode
- echo.
- echo ████ ████ ██ ██ ████ ████ █████ █████ █████ █████
- echo █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
- echo ████ ████ █ █ █ ████ ████ █ ██ █ █████ █████ █ █
- echo █ █ █ █ █ █ █ █ █ █ █ █ █
- echo █ █ █ █ █ ████ █████ █ █ █ █████
- echo.
- set /p arg=Args:
- echo Press any key to start command.
- pause > nul
- :1pro
- title FFMPEG - Working
- ffmpeg.exe !arg!
- :endpro
- title FFMPEG - Ended
- echo.
- echo 1. Retry
- echo 2. Change args
- echo 3. Restart program
- set /p command=Enter command above, blank to exit:
- if "!command!"=="1" goto 1pro
- if "!command!"=="2" goto pro
- if "!command!"=="3" goto full
- exit
Advertisement