[MPlayer-users] Audio and video slowly drifting out of sync

Timothy Jones one.timothy.jones at gmail.com
Fri Mar 26 00:13:21 CET 2010


On Thu, Mar 25, 2010 at 11:31 AM, Rolf Ernst <rolf.ernst at silverlightning.org
> wrote:

> On Thu, Mar 25, 2010 at 8:13 AM, TJ <one.timothy.jones at gmail.com> wrote:
>
> > Hiya,
> >
> > When playing HD files encoded with h.264, video progressively goes out of
> > sync
> > with (lags behind) the audio. I tried it on 2 different computers. Here
> are
> > the
> > commands I used:
> >
> > mplayer -cache 8192 - < capture-00.flv
> > mplayer -vo vdpau -vc ffh264vdpau -cache 8192 - < capture-00.flv
> >
> > Without VDPAU acceleration, CPU usage does not go above 50% (it's Core 2
> > Duo
> > 1.83GHz computer). With VDPAU CPU usage is below 10%. But still in both
> > cases
> > video slowly lags more and more behind the audio.
> >
> > If I add -framedrop option, it fixes the problem, but I see jerks once in
> a
> > while. Without the option the video plays smoothly.
> >
> > I am using MPlayer SVN-r29796-4.3.4.
> >
> > The original files are encoded using ffmpeg with the following command:
> >
> > ffmpeg \
> > -f rawvideo -s 1280x720 -pix_fmt uyvy422 -r 59.94 -i /dev/sdivideorx0 \
> > -f s16le -ar 48000 -ac 2 -i /dev/sdiaudiorx0 \
> > -vcodec libx264 -vpre custom -vb 4000000 -threads 0 \
> > -acodec libfaac -ab 256k \
> > -f flv - > capture-00.flv
> >
> > I know the original files are good, as I can play them on the mac with no
> > glitches. I tried using different container (-f mpegts) but that didn't
> > help.
> >
> > I was thinking maybe this has something to do with the monitor refresh
> rate
> > being 60Hz while the video is 59.94Hz.
> >
> > Does anybody have any suggestions on what I can do to fix this?
> >
> > Thank you.
> >
> > -TJ
> >
> Just noticed you are doing faac encoding:
>
> Here are my settings for that:
>
> "C:\Bin\mencoder.exe" "E:\rip\Tudors - S03E03.TS.12.TS" -o
> "D:\Enc_Out\Tudors - S03E03.TS.12.mkv"  -ovc x264 -x264encopts
>
> threads=0:bframes=5:b-adapt=2:partitions=all:cabac:nopsnr:nossim:mixed_refs:frameref=6:weight_b:b_pyramid=normal:me=umh:merange=16:subme=6:analyse=all:8x8dct=1:trellis=1:psy-rd=1,1:no-fast-pskip=1:crf=23
> -oac faac -faacopts br=160:mpeg=4:object=1 -vf
> crop=1264:704:8:10,scale=720:480 -fps 60000/1001
>
>
Rolf, Thank you brother. I am using ffmpeg to capture the files, but if
nothing else works, I will try mencoder. I am capturing uncompressed live
feed (HD-SDI with embedded audio). Then the file, while it is being
recorded, gets piped over the network to another computer, where it is being
played back a minute or 2 behind the live feed. My x264 options are slightly
different from yours (they are hidden in ffmpeg -vpre custom preset), which
I dialed in to allow the server to keep up with the live feed. -TJ


More information about the MPlayer-users mailing list