How to use ffmpeg to convert the entire content of a folder with all of it's subfolders, but only targeting videos with the formats .mpg
, .avi
and .vob
.
Moreover, I want the output folders to be the same as the input folders and the output name to be the same as the input name, but the output file extension of course to be .mp4
.
I tried writing a batch script to do so, but to no avail.
@echo off
set "source_folder=C:\path\to\source\folder"
for /r "%source_folder%" %%F in (*.avi *.mpg *.vob) do (
ffmpeg -i "%%F" -c:v libx264 -c:a aac -strict experimental -b:a 192k "%%~dpnF.mp4"
)