Copy to Clipboard
@echo off
REM Loop through each argument (dragged item)
:loop
if "%~1"=="" goto end
REM Create a directory for the current item
mkdir "D:\video\temp\%~n1"
FOR /F "tokens=*" %%G IN ('DIR "%~1" /B /S /A:-d') do (
FOR /F "tokens=*" %%H IN ('DIR "%%G" /B /A:-d') do (
"C:\Program Files\Handbrake\HandBrakeCLI" -i "%%G" --optimize -o "D:\video\temp\%~n1\%%~nH.mp4" -e nvenc_h265 -q 26 --cfr --aencoder av_aac --verbose=1
)
)
REM Shift arguments to process the next item
shift
goto loop
:end
pause
Thanks to Dave for this script: https://www.youtube.com/watch?v=dJJpCxoNgoM | |
Search Keywords: Handbrake, batch, convert, mpeg |