[MEncoder-users] mp4 audio slipping when played back in Quicktime

Erik Slagter erik at slagter.name
Sun Apr 6 11:58:01 CEST 2008


Jorge Peixoto de Morais Neto wrote:
> On Wed, Apr 2, 2008 at 8:21 PM, Nicolas Hesler
> <nicolas.hesler at sheridanc.on.ca> wrote:
>> I've successfully created an MP4 with mencoder using the following command line.  The file plays back normally using VLC but when played back in Quicktime, the audio slips by a couple of frames after about a minute. Any idea why this might be happening and how I might be change my command line options to make Quicktime happy?
>>
>>  Note: I'm frameserving from Premiere and so my source should not inherently have a sync issue. (or so i assume)
>>  and my video source is only about a minute long, so the slippage is noticeable by the end of the video.
>>
>>  mencoder -of lavf -sws 9 -lavfopts format=mp4 -vf dsize=1280:720:0,scale=0:0,expand=1280:720,harddup -ovc x264 -x264encopts bitrate=5000:qcomp=0.7:qp_min=1:direct_pred=auto:keyint=48:partitions=all:me=umh:subq=7:frameref=8:trellis=2:global_header:pass=1:psnr -oac faac -faacopts mpeg=4:object=2:br=224:raw -channels 2 -srate 48000
> 
> 1) Try encoding to .avi and then using an external tool for muxing to mp4
> 2) Why qp_min=1?
> 3) Why these faacopts?

I that case I'd recommend encoding the audio and video streams 
separately and hand these to mp4box (gpac). Mp4box cannot handle h264 in 
avi... (which is the reason I do not use mencoder to encode to h264 in 
the first place)

The mp4 muxer of ffmpeg (-of lavf) is quite good but not perfect. I also 
sometimes see strange issues (for instance when you use mp4box to query 
the resulting file). I think you're better off using mp4box (gpac) for 
the muxing.

Ad 3: you need "raw" because aac-in-mp4 is stored without headers and 
with global metadata instead. If you don't specify raw, your file will 
not be compliant.

If you use an external muxer, you shouldn't use raw, though, of course.


More information about the MEncoder-users mailing list