iMovie compatible mencoder settings for mp4
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)? Thanks, tc.
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
Towncat wrote: 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.
On Sat, Jun 6, 2009 at 6:05 PM, James Hastings-Trew <jimht@shaw.ca> wrote:
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.
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
Thanks, I'll try these. You are completely right about compression, I should have considered this, too. The script was originally intended to make good mp4s from mpeg recordings, that's why.
On Sat, Jun 6, 2009 at 6:20 PM, Towncat <towncat.towncat@gmail.com> wrote:
On Sat, Jun 6, 2009 at 6:05 PM, James Hastings-Trew <jimht@shaw.ca> wrote:
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.
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
Thanks, I'll try these. You are completely right about compression, I should have considered this, too. The script was originally intended to make good mp4s from mpeg recordings, that's why.
Great, thanks, it did the trick! tc
James Hastings-Trew wrote:
-of lavf -lavfopts format=mp4 -o $OUTPUTFILE.mp4
I thought this was horribly broken. I know from experience the PS3 won't accept these files. Unless, of course, it was fixed in a recent revision...
Andrew Berg wrote:
James Hastings-Trew wrote:
-of lavf -lavfopts format=mp4 -o $OUTPUTFILE.mp4
I thought this was horribly broken. I know from experience the PS3 won't accept these files. Unless, of course, it was fixed in a recent revision...
Its ok as long as there are no bframes, which there weren't with the parameters I gave. I wouldn't use the PS3's refusal to read a file as indicative of anything other than how narrowly Sony defined what format would be acceptable. It's quite a fussy device.
James Hastings-Trew wrote:
Its ok as long as there are no bframes, which there weren't with the parameters I gave. Ah. I wouldn't use the PS3's refusal to read a file as indicative of anything other than how narrowly Sony defined what format would be acceptable. It's quite a fussy device.
I meant it as an example, not an indicator. I remember having problems and the response I got on this list was that the lavf MPEG-4 muxer was broken. I've been using MP4Box since then.
participants (3)
-
Andrew Berg -
James Hastings-Trew -
Towncat