[MPlayer-users] x264 encoding/matroska/etc.

Fredrik Eriksson feffese at yahoo.se
Tue Sep 12 10:23:56 CEST 2006


Hello.

On 11-09-2006, at 22:24, Vítězslav Kotrla wrote:

> Peter Gavin píše v St 23. 08. 2006 v 20:28 +0200:
>
>> So I've determined that its pretty much impossible (atm) to use
>> mencoder to create an x264 file which can be muxed into a matroska
>> container, and still maintain A/V sync.  I'm trying to backup my  
>> DVDs,
>> and my most recent attempt involved encoding using -of rawvideo, but
>> the A/V sync was way off.  If I use -of avi, the sync is perfect, but
>> of course, mkvmerge won't accept the file.
>
> Peter, right now I tried
>
> $ mkvmerge --engage allow_avc_in_vfw_mode -o test.mkv title-x264- 
> hq.avi
> title.ac3

Not a good idea...

>
> and it works fine, A/V sync is spot on. The same for Vorbis Ogg audio,
> no A/V sync problems whatsoever.
>
> AVI file was obtained using
>
> #!/bin/sh
> SOURCE=stream.dump
> NAME=title-x264-hq
> BITRATE=1400
> CROP="704:432:8:76"
> SCALE="704:304"
> # x264 very high quality
> # subq=6:4x4mv:8x8dct:me=3:frameref=5:bframes=3:b_pyramid:weight_b
> for i in 1 2 ; do
>    mencoder $SOURCE -nosound -ovc x264 \
>    -x264encopts
> subq=6:frameref=5:4x4mv:me=3:8x8dct:bframes=3:b_pyramid:weight_b:bitra 
> te=${BITRATE}:pass=${i}:threads=2:psnr \
>    -sws 9 -vf crop=${CROP},scale=${SCALE} \
>    -o ${NAME}.avi -force-avi-aspect 232/100
> done
>
> $ mplayer --version
> MPlayer dev-SVN-r19633-4.1.2 (C) 2000-2006 MPlayer Team
>
> $ mkvmerge --version
> mkvmerge v1.7.0 ('What Do You Take Me For') built on Apr 29 2006
> 14:55:19
>
> Only my USD 0.02.
>
> Vit

I'm not 100% certain, but I think that the matroska file you just  
created can cause problem for some players. you should never use avc  
and vfw. I create matroska with x264 using mencoder, by using -of  
rawvideo, mux to mp4 and then mux to mkv. The A/V sync problem could  
be because you forgot to use -vf harddup.

Fredrik Eriksson


More information about the MPlayer-users mailing list