I have the following batch-file code to convert some video files with HandBrakeCLI:
for /R .\test %%F in (*.mp4,*.avi,*.flv,*.mov,*.3gp,*.wmv,*.mkv,*.ts) do (
HandBrakeCLI -e x264 --x264-preset medium -q 35 --crop 0:0:0:0 --aencoder copy -i "%%~fF" -o "%%~dpF%%~nF_conv.mp4"
if exist "%%~dpF%%~nF_conv.mp4" (
del "%%~fF"
ren "%%~dpF%%~nF_conv.mp4" "%%~nxF"
)
)
To apply this code on videos, I should copy the batch-file and Handbrake.exe (and also its relative folders) and paste them beside the folder named test (in the code above) then change the name "test" in the batch file to the name of that folder, then run the batch-file.
Could you write the batch-file in a way we run it in an arbitrary folder, so it prompt for a folder containing videos and we write the path (or just simply drag and drop the folder to the command line and press enter) without moving the files and renaming the "test"?