[FFmpeg-user] Convert some hundreds files to a H264

Mailing List mblainml at earthlink.net
Tue May 17 18:24:08 CEST 2011


marcos rebelo <oleber at gmail.com> wrote in
news:BANLkTi=43-RGdG9h4LPx+mi2AcxdZyv-zQ at mail.gmail.com: 

> I was giving some hundreds of files (more will come) with
> different formats (div, avi, mov, ...) and different sizes to be
> converted to H264 with:
>    a maximum width 720,
>    -b         500k
>    -bt        500k
>    -acodec  libfaac

As others have suggested, using a simple loop to process the files is not
particularly difficult.  The only issue is your "maximum width 720".  Using
-vf "scale=720:-1" is unreliable because it throws errors for odd-numbered
heights, instead of rounding to a usable value as mencoder can.  

You could parse the output of either "ffprobe" or "ffmpeg -i" for the
display aspect ratio and use it to calculate scaling dimensions, but it
makes the script considerably more complex.  My own crude solution is in
Windows batch, which wouldn't help you with Perl.



More information about the ffmpeg-user mailing list