[MEncoder-users] a/v desync when encoding combined 24000/1001 30000/1 fps NTSC DVD

Sergey Kovalev mplayer at kovalev.com.ru
Mon Feb 23 18:14:26 CET 2009


I would like to encode several iso-dvds to something smaller.
ISO in question is attached as /dev/md0 on my freebsd box.
While playing it I sometimes get messages at fixed points

$ mplayer dvd://1
MPlayer 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 2500+ (Family: 6, Model: 10, Stepping: 0)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

A: 182.9 V: 182.9 A-V: -0.000 ct:  0.054 5475/5472  4%  0%  1.7% 6 0
demux_mpg: 24000/1001fps progressive NTSC content detected, switching 
framerate
A: 201.9 V: 201.9 A-V:  0.022 ct:  0.080 5931/5928  4%  0%  1.8% 6 0
demux_mpg: 30000/1001fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994005) [4]  0%  1.8% 6 0
A: 286.8 V: 286.8 A-V:  0.004 ct:  0.138 8476/8470  6%  0%  2.5% 6 0
demux_mpg: 24000/1001fps progressive NTSC content detected, switching 
framerate
etc.

So I've decided that I have "11.2.3.4. Mixed progressive and telecine" 
according to documentation. The problem arises when I try to encode 
audio. When I copy with -oac copy everything is fine, 448 kbit/s ac3 
stream is preserved.
But when I encode audio reducing abitrate, I do two-pass encoding with a 
shell script:

mencoder dvd://1 -chapter 3-3 -aid 129 \
     -ofps 24000/1001 -oac lavc -o $fname -ovc lavc -lavcopts \
     vcodec=mpeg4:vbitrate=1152:mbd=2:trell:v4mv:autoaspect:vpass=$i \
     -vf pullup,softskip,crop=656:352:32:64

where $fname and $i are shell variables with corresponding values.

The resulting avi shows enormous a/v desync:
A:15869.7 V:  25.9 A-V:15843.711 ct:  2.590 622/622  5%  1%  0.6% 0 0
if I understand A:, V: and A-V: numbers correctly. Seeking on audio 
stream is almost impossible. And forward seeking often leads to warnings:

Badly interleaved AVI file detected - switching to -ni mode...

Besides ct: value is always growing. That leads to the actual desync 
which can only be avoided by using -mc 0 while playing.
I've already tried "-vf filmdint", "-mc 0" "-*idx", but the results were 
almost the same.
Does anybody know why is this happening? I suppose I don't understand 
something important here.



More information about the MEncoder-users mailing list