[MPlayer-users] xvid encode from HDTV MPEG audio sync problems...

Steve Adeff adeffs at gmail.com
Mon Jan 9 20:45:56 CET 2006


On Monday 09 January 2006 10:03, Jason Tackaberry wrote:
> On Mon, 2006-01-09 at 09:37 -0500, Steve Adeff wrote:
> > mencoder inputfile.mpg -oac copy -ovc xvid -vf
> > pullup,softskip,scale=960:544 -ofps 24000/1001 -xvidencopts
> > pass=2:max_iquant=3:max_pquant=6:max_bquant=7:vhq=0:me_quality=5:turbo:qu
> >ant_type=mpeg:aspect=1.78:bitrate=-595000 -o outputfile.avi
>
> You shouldn't use turbo on pass 2.  And do you really need to specify
> the max quantizers like this?  Is xvid seriously undershooting the
> target size?
>
> > The problem is, the huffyuv file created is like ~40gig, so being able to
> > do it directly would be much better.
>
> With a single pass, you could just use a pipe, but of course this
> doesn't work with 2 pass.  Although in that case you probably couldn't
> use a negative value for bitrate, since it won't know how long the video
> is, and so couldn't calculate the appropriate bitrate for the target
> size.
>
> > So, am I doing something wrong thats causing the audio sync problem, is
> > there a bug? How do I figure this stuff out to see if it can be fixed?
>
> This problem is likely caused by the use of B-frames, which mencoder has
> problems with. You can disable B-frames with max_bframes=0.
> Alternatively, you could remux the file afterward.  I usually still use
> B-frames, but remux to a matroska file with mkvmerge.  Although it often
> requires specifying --delay to compensate, which requires some manual
> intervention to get the appropriate offset.  If you want to automate
> this completely, your best solution is to disable B-frames.
>
> Cheers,
> Jason.

Great! that worked. What did exactly, I don't know. I took out the turbo from 
the pass 2 command and set max_bframes=0 and my test encode came out in sync 
through the whole encode.

Out of curiosity, what side effects will the max_bframes=0 command have on 
quality?

One final question while I'm here... Is there a way to tell mencoder that I 
want the total file size to be X instead of giving it just the video file 
size? Right now I basically guess as to the total size of the audio and 
overhead to get around 700MB.

-- 
thanks!
Steve




More information about the MPlayer-users mailing list