Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Coded by Nightsanity Copyright (c) 2014
- @echo off
- ::SET TO CURRENT CODE PAGE:::::::::::::::::::::::::::
- FOR /F "tokens=4 delims= " %%G in ('chcp') DO (
- chcp %%G >nul
- )
- :::::::::::::::::::::::::::::::::::::::::::::::::::::
- setlocal EnableExtensions
- title AniCoder v2.5 by Nightsanity
- color 0a
- cd "%~d0%~p0"
- ::PREVENT MULTIPLE HANDBRAKE PROCESSES::::::::::::::::
- set ignore=INFO:
- for /f "usebackq" %%A in (`tasklist /nh /fi "imagename eq HandBrakeCLI.exe"`) do if not %%A==%ignore% (
- exit
- )
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::PREREQUISITES CHECK:::::::::::::::::::::::::::::::::
- if not exist "HandBrakeCLI.exe" (
- echo HandBrakeCLI is missing!
- pause
- exit
- )
- if exist "Jobs.txt" del "Jobs.txt"
- if not exist "ToConvert" mkdir "ToConvert"
- if not exist "Converted" mkdir "Converted"
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::CREATE A LIST OF VIDEOS TO CONVERT:::::::::::::::::::
- for /F %%i in ('dir /s /b "ToConvert\*.*"') do (
- dir/s/b "ToConvert\*" >> "Jobs.txt"
- goto MAIN
- )
- goto NOFILES
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::LOOP THROUGH JOBS LIST AND CONVERT FILES:::::::::::::
- :MAIN
- for /f "tokens=* delims= " %%a in (Jobs.txt) do (
- HandBrakeCLI -i "./ToConvert/%%~nxa" -f mp4 -o "./Converted/%%~na.mp4" -q 22 -e x264 -x cabac=0:ref=2:me=hex:bframes=0:weightp=0:subme=6:8x8dct=0:trellis=0 -E faac --mixdown mono -B 64 -X 480 -l 272 -s 1 --subtitle-burn -a 1
- )
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::CLEAN UP FILES:::::::::::::::::::::::::::::::::::::::
- if exist "Jobs.txt" del "Jobs.txt"
- :Question
- cls
- echo Encode Done!
- echo.
- set DELFILES=
- set /p DELFILES="Do you want to delete original files (Y/N)?:"
- if "%DELFILES%" == "y" goto DELNOW
- if "%DELFILES%" == "Y" goto DELNOW
- if "%DELFILES%" == "n" goto ENDNOW
- if "%DELFILES%" == "N" goto ENDNOW
- goto Question
- :DELNOW
- if exist "ToConvert\*.*" del /Q "ToConvert\*.*"
- :ENDNOW
- endlocal
- exit
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::WHEN NO FILES ARE INSIDE TOCONVERT FOLDER::::::::::::
- :NOFILES
- echo No video files found in:
- echo ToConvert folder
- echo.
- pause
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement