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

Stefano Sabatini stefano.sabatini-lala at poste.it
Wed May 18 12:07:21 CEST 2011


On date Tuesday 2011-05-17 12:24:08 -0400, Mailing List encoded:
> 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 can rely on expression evaluation (recently added):

-vf "scale=720:trunc(ow/a/vsub)*vsub"

ow/a is the scaled height, in this case you get the final height an
integer multiple of the chroma vertical subsampling value. Many
variations are possible.
-- 
ffmpeg-user random tip #14
Smart questions (un)official document:
http://www.catb.org/~esr/faqs/smart-questions.html


More information about the ffmpeg-user mailing list