[MEncoder-users] Re: quicktime compatible mp4 using x264encopts?

Jon Drukman jsd at cluttered.com
Tue Jul 11 22:57:25 CEST 2006


Guillaume POIRIER wrote:
> Hi,
> 
> On 7/10/06, Jon Drukman <jsd at cluttered.com> wrote:
>> In case anyone besides me cares, we figured out a way to make this work:
>>
>> transcode video to raw H.264 (-of rawvideo) using mencoder with -x264opts
>> transcode audio to aac file with ffmpeg
>> mux video + audio with mp4box
>>
>> this generates a .mp4 file that will play in quicktime player.
> 
> Could you please provide a sample command line for each of these steps?
> I'd like to add this information to MEncoder's doc.
> You're not the only one who asked how to create files compatible with
> QuickTime, nor will you be the last one.

here's what i have at the moment.  one thing to note is that sometimes 
it will still generate files that don't play in quicktime.  (they will 
play in other mp4/h.264 capable apps though)

i can't figure out why, but it seems to depend on the input video.  why 
that would make any difference... i have no idea.  maybe someone else 
can figure it out.

adjust bitrate, scale, and fps to taste.

#!/bin/sh

infile=$1

rm -f "$infile.264"

mencoder "$infile" -sws 9 -vf 
'harddup,lavcdeint,scale=640:368,smartblur=.6:-.3:0,unsharp=l3x3:1:c3x3:1:analyse=0x1:0:deblock=0:0:0,softskip,hue=0:1.3' 
-ovc x264 -x264encopts 
subq=6:i4x4:noi8x8:8x8mv:b8x8mv:4x4mv:bitrate=1750 -ofps 30000/1001 
-nosound -of rawvideo -o "$infile.264"

rm -f "$infile.aac"

ffmpeg -y -i "$infile" -vn -f aac -ar 48000 -ab 128 -coder 0 -ac 2 
-acodec aac "$infile.aac"

rm -f "$infile.mp4"

MP4Box -fps 29.97 -add "$infile.264" -add "$infile.aac" "$infile.mp4"




More information about the MEncoder-users mailing list