[MEncoder-users] iMovie compatible mencoder settings for mp4
James Hastings-Trew
jimht at shaw.ca
Sat Jun 6 18:05:36 CEST 2009
Towncat wrote:
> Hi folks,
> I was trying to import an mpg movie (recorded with a Sony Handycam) into
> iMovie '08. As it failed to do so with the original mpg file, and some
> googling told me that it should be compatible with mp4 files, I tried to
> convert the file into a QuickTime compatible .mp4 (based on the mencoder
> documentation's advice). Here's my small script:
>
> ---
>
> mencoder $INPUTFILE -ovc x264 -x264encopts
> subq=1:frameref=1:threads=4:bframes=1:pass=1:bitrate=$VBITRATE:vbv_maxrate=$VBITRATE_MAX:vbv_bufsize=5000:cabac:nofast_pskip:nodct_decimate:turbo=1
> -oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -srate 48000 -vf
> scale=-10:-1,harddup -ofps 25 -o /dev/null
>
> mencoder $INPUTFILE -ovc x264 -x264encopts
> subq=6:frameref=6:partitions=all:me=umh:threads=4:bframes=1:pass=2:bitrate=$VBITRATE:vbv_maxrate=$VBITRATE_MAX:vbv_bufsize=5000:cabac:nofast_pskip:nodct_decimate:keyint=300
> -oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -srate 48000 -vf
> scale=-10:-1,harddup -ofps 25 -idx -o tmp.$OUTPUTFILE.avi
>
> mplayer tmp.$OUTPUTFILE.avi -dumpaudio -dumpfile $OUTPUTFILE.aac
>
> mplayer tmp.$OUTPUTFILE.avi -dumpvideo -dumpfile $OUTPUTFILE.h264
>
> mp4creator -create=$OUTPUTFILE.aac $OUTPUTFILE.mp4
> mp4creator -create=$OUTPUTFILE.h264 -rate=25 $OUTPUTFILE.mp4
>
> mp4creator -hint=1 $OUTPUTFILE.mp4
> mp4creator -hint=2 $OUTPUTFILE.mp4
> mp4creator -optimize $OUTPUTFILE.mp4
>
> ---
>
> However, iMovie still says that the file is incompatible.
>
> Do you have a suggestion as to what settings to use in mencoder to create an
> iMovie-importable movie (without much loss of data, of course)
Since you are editing the footage, compression is of secondary concern,
so you can skip all the fancy options intended to aid compression - they
simply eat up time. You simply want the file in the right format with as
little degradation as possible, as quickly as possible:
mencoder $INPUTFILE -oac faac -faacopts br=192:mpeg=4:object=2:raw
-channels 2 -srate 48000 -ovc x264 -x264encopts
crf=18:nofast_pskip:nodct_decimate:nocabac:global_header:threads=4 -of
lavf -lavfopts format=mp4 -o $OUTPUTFILE.mp4
The result will open directly in iMovie. I recommend "nocabac" as the
result will read faster in iMovie. If you find that you can't scrub
through the movie very quickly in iMovie, try putting the keyint=300 (or
even a lower value) back into the -x264encopts.
More information about the MEncoder-users
mailing list