[MPlayer-users] mencoder, x264, vorbis, matroska - bad a/v sync problems

matthew.garman at gmail.com matthew.garman at gmail.com
Wed Feb 14 20:57:17 CET 2007


On Wed, Feb 14, 2007 at 07:55:12AM -0800, RC wrote:
> > mplayer dvd://1 -ao pcm:fast:file=audio.wav -vc dummy -aid 128 -vo
> > null 
> 
> You might try -vc null . 

Will do.

> > normalize audio.wav
> 
> I wouldn't recomend that.  vorbisgain will accomplish the same
> thing, losslessly. (I don't specifically know if those gain tags
> will be copied over into an MKV)

So "normalize" is lossy?  That's good to know.

I would assume MKV can support gain tags, as it appears as though
it's trying to be the "do everything" container.

FWIW, the Matroska container isn't necessary.  My requirements are
no filesize limitation, and can store h264 video and vorbis audio.
I have portability in mind, although for now and the forseeable
future, my only target platform is mplayer on linux.

I'll try this same process with ogm and mp4.

> >     ds=auto:pass=1:turbo=1:bframes=4:b_pyramid:weight_b \ -idx -ofps
> 
> I would at least try it once with bframes=0 instead.

I'm certainly willing to try that; I've just assumed so far that
bframes=4 is best for quality with x264, based on the mencoder x264
guide[1].

> > avi2raw video.avi video.h264
> > MP4Box -fps 23.97602 -add video.h264 video.mp4
> 
> I definately don't do that...  I always mux straight from the AVI.
> Your framerate certainly doesn't seem accurate, either.
>
> Of course you could always try muxing with ffmpeg/mpeg4ip instead.

Well, the mkvmerge tool won't take AVI directly[2].  You're muxing
into OGM, right?  FWIW, I've also tried -of rawvideo in the video
encoding stage; that saves me the "avi2raw" step, but the MP4Box is
still a prerequisite for mkvmerge.  (Again suggesting that I should
try a different container.)

What's wrong with the framerate?  That number is 24000/1001
rounded...

Someone on Doom9's forum suggested not using -idx.  What are your
thoughts on that?

> The big question:  Are you sure the ENCODING is causing the
> desync?  Perhaps MPlayer is the problem, introducing desync when
> playing it back... 

Such an obvious question never occurred to me!  I guess I just
assumed mplayer would be the last place I'd have problems.  Is the
only way to test this to try with other players, such as Xine and
(shudder) Windows Media Player?


Thanks again,
Matt


[1] http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html
    "Usually, even a naive B-frame choice algorithm can have a
    significant PSNR benefit."

[2] If I do a "mkvmerge -o outfile.mkv video.avi audio.ogg", I get a
    huge warning message.  Basically, it suggests to either do what
    I'm doing (use avi2raw, MP4Box) or store it in non native
    Matroska mode AVC ala the --engage allow_avc_in_vfw_mode switch.
    Though they prefix the latter suggestion with "If you really
    know what you are doing..." (which I don't think applies to
    me).




More information about the MPlayer-users mailing list