I have created a batch file (.bat) that uses FFmpeg to transcode various videos (with *.mov or *.mp4 file name extension) from an input folder to an output folder (with extension *.mkv) as batch process (Windows 10 environment). File names (without extension) from the input folder should be copied to the newly created output file names (that have the new file extension *.mkv).
@echo off
set CMD=ffmpeg -c:v ffv1 -level 3 -g 1 -coder 1 -context 1 -pix_fmt + -slices 24 -slicecrc 1 -report -c:a pcm_s24le
FOR /R input_folder %%G IN (*.mov,*.mp4) DO (
echo %%G
call set outputfile=%%~nG%.mkv
call set inputfile=%%~nG%%~xG
echo %CMD% -y output_folder/%outputfile% -i %inputfile%
)
But this script does not work as expected, i.e. nothing happens. Do you perhaps have an idea how to fix this? Thanks in advance!
DOportion of the script will not run. If there are files matching the*.movor*.mp4globs, then each of those will beechoed quickly to the screen, as will your writtenffmpegcommand before the script closes.echoing off, and run your script directly from the Command Prompt window, (with your target parent path/tree root as the current working directory). You should then see all of the output to determine what is really happening. I'd advise that you changeecho %CMD%to%CMD%, if you really wantffmpegto process matching files. BTW, both of yourcall setlines are redundant, you should remove them and changeecho %CMD% -y output_folder/%outputfile% -i %inputfile%to%CMD% -y "output_folder\%%~nG.mkv" -i "%%G".