I am trying to convert 20+ .avi files in a batch using ffmpeg.
I've got the following
@echo off.
for file in *.avi
do
ffmpeg -i "$file" -s 640x480 -vcodec msmpeg4v2 "'basename "$file" .avi'.mpg';
done
in my .bat file but it does not work. How can I make it work under Windows OS. Oh, and yes all the files are in the same folder.
The error message I get:
File was unexpected at this time
cmd) and then run the batch file using its full path from there. What do you actually want to do with the videos? What kind of videos are these? Do you just need to move them to an MPG container? Or do you need to resize them? Or do you specifically need themsmpeg4v2codec? – slhck♦ Sep 5 '12 at 19:42ffmpeg -i input.avi -c:v libx264 -crf 23 -s 640x480 output.mp4where the CRF value sets the quality (less is better, more is worse, sane values from 19 to 24). See also: Convert old videos to have smaller sizes and What parameters should I be looking at to reduce the size of a .MOV file? – slhck♦ Sep 5 '12 at 19:55