[MPlayer-users] mencoder frame dropping inconsistencies, depending on audio source??

Charles Wilcox willo at wpi.edu
Sat Mar 27 16:48:09 CET 2004


I am trying to solve some audio-video sync problems in DivX files created
from DVD source.  Specifically, I'm trying to figure out what governs the
varying output length of each video and audio track.

Outside of this general annoyance, I have discovered (at least for few
DVDs I have) mencoder will choose different sequences of frames to drop,
and will sometimes drop a different number of frames, depending on if I
tell the "output audio codec" to copy the raw AC3 audio stream, or to copy
the frameno.avi stream created with the mp3lame codec.

This really does not make sense to me.  Could someone provide some useful
insight??  I've attached a copies of the output as an explicit example.
Also, I did -dumpstream on the DVD track previously, to eliminate the
possibility of a mis-behaving DVD reader.

 -- Charles Wilcox

P.S.  Using MPlayer-1.0pre3 and lame-3.95.1 source.

P.P.S.  If anyone has any other pointers on general A-V sync in encoded
DivX files that isn't already in the HTML docs, please pass those along
too.
-------------- next part --------------
willo at csopt2:/xtra_space/willo/ttt-1>~/pkg/x86_64/mplayer/bin/mencoder stream.du
mp -aid 130 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=5 -vf crop=712
:358:4:58,scale=528:224 -oac copy -o test.avi
MEncoder 1.0pre3-3.2.2 (C) 2000-2003 MPlayer Team

Reading /users/willo/.mplayer/codecs.conf: Can't open '/users/willo/.mplayer/cod
ecs.conf': No such file or directory
Reading /users/willo/pkg/x86_64/mplayer/etc/mplayer/codecs.conf: Can't open '/us
ers/willo/pkg/x86_64/mplayer/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
File not found: 'frameno.avi'
Failed to open frameno.avi
Reading config file /users/willo/.mplayer/mencoder: No such file or directory
font: can't open file: /users/willo/.mplayer/font/font.desc
font: can't open file: /users/willo/pkg/x86_64/mplayer/share/mplayer/font/font.d
esc
success: format: 0  data: 0x0 - 0x7132F800
LMLM4 Stream Format not found
MPEG-PS file format detected.
VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  9001.6 kbps (1125.2 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x480  fps:29.97  ftime:=0.0334
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
No accelerated IMDCT transform found
AC3: 2.0 (dolby)  48000 Hz  192.0 kbit/s
No accelerated resampler found
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 24000->192000 (192.0 kbit)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=528 h=224]
Opening video filter: [crop w=712 h=358 x=4 y=58]
Crop: 712 x 358, 4 ; 58
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.3.1
Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG 1 or 2 (libmpeg2))
==========================================================================
audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 bps=24000 sample=1
)
Writing AVI header...
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 7 -> 6
SwScaler: reducing / aligning filtersize 7 -> 6
SwScaler: reducing / aligning filtersize 8 -> 7
SwScaler: reducing / aligning filtersize 8 -> 7

SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using C
videocodec: libavcodec (528x224 fourcc=58564944 [DIVX])
Using constant qscale = 5.000000 (VBR)
New_Face failed. Maybe the font path is wrong.  0mb  A-V:0.000 [0:0]
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Pos:   0.1s      4f ( 0%)   0fps Trem:   0min   0mb  A-V:0.010 [0:0]
1 duplicate frame(s)!
Pos:   0.3s      7f ( 0%)   0fps Trem:   0min   0mb  A-V:0.020 [0:0]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.

1 duplicate frame(s)!
Pos:   0.8s     17f ( 0%)   0fps Trem:   0min   0mb  A-V:0.061 [0:192]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.065 [0:192]
Pos:   1.2s     27f ( 0%)   0fps Trem:   0min   0mb  A-V:0.037 [20:192]
1 duplicate frame(s)!
Pos:   1.4s     32f ( 0%)   0fps Trem:   0min   0mb  A-V:0.030 [19:192]
1 duplicate frame(s)!
Pos:   1.7s     37f ( 0%)   0fps Trem:   0min   0mb  A-V:0.028 [20:192]
1 duplicate frame(s)!
Pos:   1.9s     42f ( 0%)   0fps Trem:   0min   0mb  A-V:0.028 [24:192]
1 duplicate frame(s)!
Pos:   2.2s     47f ( 0%)   0fps Trem:   0min   0mb  A-V:0.030 [30:192]
1 duplicate frame(s)!
Pos:   2.4s     52f ( 0%)   0fps Trem:   0min   0mb  A-V:0.032 [31:192]
1 duplicate frame(s)!
Pos:   3.0s     66f ( 0%)   0fps Trem:   0min   0mb  A-V:0.034 [41:192]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
Pos:  11.6s    270f ( 0%)  56fps Trem:  43min 283mb  A-V:0.012 [171:192]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.011 [171:192]
Pos:  11.7s    274f ( 0%)  56fps Trem:  43min 284mb  A-V:0.007 [169:192]
1 duplicate frame(s)!
Pos:  12.0s    279f ( 0%)  56fps Trem:  44min 284mb  A-V:0.003 [166:192]
1 duplicate frame(s)!
Pos:  12.2s    284f ( 0%)  57fps Trem:  44min 286mb  A-V:-0.013 [163:192]
1 duplicate frame(s)!
Pos:  12.5s    289f ( 0%)  57fps Trem:  44min 286mb  A-V:-0.029 [160:192]
1 duplicate frame(s)!
Pos:  12.7s    294f ( 0%)  57fps Trem:  44min 286mb  A-V:-0.035 [157:192]
1 duplicate frame(s)!
Pos:  13.0s    299f ( 0%)  57fps Trem:  45min 286mb  A-V:-0.039 [155:192]
1 duplicate frame(s)!
Pos:  13.6s    313f ( 0%)  58fps Trem:  44min 288mb  A-V:-0.046 [150:192]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
Pos:  14.1s    324f ( 0%)  58fps Trem:  45min 289mb  A-V:-0.050 [147:192]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :-0.051 [146:192]
Pos:  14.2s    328f ( 0%)  58fps Trem:  45min 289mb  A-V:-0.056 [145:192]
1 duplicate frame(s)!
Pos:  14.6s    337f ( 0%)  58fps Trem:  46min 290mb  A-V:-0.084 [142:192]
2 duplicate frame(s)!
Pos:  14.8s    340f ( 0%)  58fps Trem:  46min 291mb  A-V:-0.053 [140:192]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
Pos:  15.8s    364f ( 0%)  59fps Trem:  47min 299mb  A-V:-0.086 [137:192]
1 duplicate frame(s)!
Pos:  16.8s    386f ( 0%)  60fps Trem:  48min 302mb  A-V:-0.084 [130:192]
1 duplicate frame(s)!
Pos:6392.3s 153243f (99%)  45fps Trem:   0min 588mb  A-V:0.031 [578:192]]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.027 [578:192]
Pos:6392.6s 153250f (99%)  45fps Trem:   0min 588mb  A-V:0.009 [578:192]
1 duplicate frame(s)!
Pos:6392.8s 153255f (99%)  45fps Trem:   0min 588mb  A-V:0.002 [578:192]
1 duplicate frame(s)!
Pos:6393.1s 153260f (99%)  45fps Trem:   0min 588mb  A-V:-0.007 [578:192]
1 duplicate frame(s)!
Pos:6393.3s 153265f (99%)  45fps Trem:   0min 588mb  A-V:-0.020 [578:192]
1 duplicate frame(s)!
Pos:6393.6s 153270f (99%)  45fps Trem:   0min 588mb  A-V:-0.027 [578:192]
1 duplicate frame(s)!
Pos:6393.8s 153275f (99%)  45fps Trem:   0min 588mb  A-V:-0.029 [578:192]
1 duplicate frame(s)!
Pos:6394.1s 153280f (99%)  45fps Trem:   0min 588mb  A-V:-0.029 [578:191]
1 duplicate frame(s)!
Pos:6394.3s 153285f (99%)  45fps Trem:   0min 588mb  A-V:-0.026 [578:191]
1 duplicate frame(s)!
Pos:6394.6s 153290f (99%)  45fps Trem:   0min 588mb  A-V:-0.024 [578:192]
1 duplicate frame(s)!
Pos:6394.8s 153295f (99%)  45fps Trem:   0min 588mb  A-V:-0.020 [578:192]
1 duplicate frame(s)!
Pos:6395.1s 153300f (99%)  45fps Trem:   0min 588mb  A-V:-0.020 [577:192]
1 duplicate frame(s)!
Pos:6395.3s 153305f (99%)  45fps Trem:   0min 588mb  A-V:-0.028 [577:192]
1 duplicate frame(s)!
Pos:6395.6s 153310f (100%)  45fps Trem:   0min 588mb  A-V:-0.033 [577:192]
1 duplicate frame(s)!
Pos:6395.8s 153315f (100%)  45fps Trem:   0min 588mb  A-V:-0.037 [577:192]
1 duplicate frame(s)!
Pos:6396.1s 153320f (100%)  45fps Trem:   0min 588mb  A-V:-0.039 [577:192]
1 duplicate frame(s)!
Pos:6396.3s 153325f (100%)  45fps Trem:   0min 588mb  A-V:-0.041 [577:192]
1 duplicate frame(s)!
Pos:6396.6s 153330f (100%)  45fps Trem:   0min 588mb  A-V:-0.041 [577:192]
1 duplicate frame(s)!
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12) [577:192]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
videocodec: libavcodec (528x224 fourcc=58564944 [DIVX])
Using constant qscale = 5.000000 (VBR)
Could not open codec.
FATAL: Cannot initialize video driver.
Pos:6396.8s 153336f (100%)  45fps Trem:   0min 588mb  A-V:-0.042 [577:192]
Writing AVI index...
Fixing AVI header...

Video stream:  577.833 kbit/s  (72229 bps)  size: 462036214 bytes  6396.813 secs                                                                              153336 frames

Audio stream:  192.000 kbit/s  (24000 bps)  size: 153514752 bytes  6396.448 secs
-------------- next part --------------
willo at csopt2:/xtra_space/willo/ttt-1>~/pkg/x86_64/mplayer/bin/mencoder stream.du
mp -aid 130 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=5 -vf crop=712
:358:4:58,scale=528:224 -oac copy -o test_lame.avi
MEncoder 1.0pre3-3.2.2 (C) 2000-2003 MPlayer Team

Reading /users/willo/.mplayer/codecs.conf: Can't open '/users/willo/.mplayer/cod
ecs.conf': No such file or directory
Reading /users/willo/pkg/x86_64/mplayer/etc/mplayer/codecs.conf: Can't open '/us
ers/willo/pkg/x86_64/mplayer/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
AVI file format detected.
VIDEO:  [FrNo]  720x480  24bpp  23.976 fps    0.8 kbps ( 0.1 kbyte/s)
Using pass3 control file: frameno.avi
Reading config file /users/willo/.mplayer/mencoder: No such file or directory
font: can't open file: /users/willo/.mplayer/font/font.desc
font: can't open file: /users/willo/pkg/x86_64/mplayer/share/mplayer/font/font.d
esc
success: format: 0  data: 0x0 - 0x7132F800
LMLM4 Stream Format not found
MPEG-PS file format detected.
VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  9001.6 kbps (1125.2 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x480  fps:29.97  ftime:=0.0334
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=528 h=224]
Opening video filter: [crop w=712 h=358 x=4 y=58]
Crop: 712 x 358, 4 ; 58
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.3.1
Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG 1 or 2 (libmpeg2))
==========================================================================
audiocodec: framecopy (format=55 chans=2 rate=48000 bits=0 bps=9545 sample=0)
Writing AVI header...
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 7 -> 6
SwScaler: reducing / aligning filtersize 7 -> 6
SwScaler: reducing / aligning filtersize 8 -> 7
SwScaler: reducing / aligning filtersize 8 -> 7

SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using C
videocodec: libavcodec (528x224 fourcc=58564944 [DIVX])
Using constant qscale = 5.000000 (VBR)
New_Face failed. Maybe the font path is wrong.  0mb  A-V:0.000 [0:0]
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Pos:   0.3s      7f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:0]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.

1 duplicate frame(s)!
Pos:   0.7s     17f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:32]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.000 [0:32]
Pos:   1.3s     32f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [20:32]
1 duplicate frame(s)!
Pos:   1.6s     37f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [21:32]
1 duplicate frame(s)!
Pos:   1.8s     42f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [25:32]
1 duplicate frame(s)!
Pos:   2.1s     47f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [31:33]
1 duplicate frame(s)!
Pos:   2.3s     52f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [32:34]
1 duplicate frame(s)!
Pos:   3.0s     66f ( 0%)  65fps Trem:   0min   0mb  A-V:0.000 [43:36]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
Pos:  11.5s    270f ( 0%)  55fps Trem:  46min 182mb  A-V:0.000 [172:54]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.000 [172:54]
Pos:  11.6s    274f ( 0%)  55fps Trem:  46min 182mb  A-V:0.000 [170:54]
1 duplicate frame(s)!
Pos:  11.9s    279f ( 0%)  56fps Trem:  46min 181mb  A-V:0.000 [167:55]
1 duplicate frame(s)!
Pos:  12.1s    284f ( 0%)  56fps Trem:  46min 182mb  A-V:0.000 [164:55]
1 duplicate frame(s)!
Pos:  12.4s    289f ( 0%)  56fps Trem:  46min 179mb  A-V:0.000 [161:55]
1 duplicate frame(s)!
Pos:  12.6s    294f ( 0%)  56fps Trem:  47min 180mb  A-V:0.000 [158:55]
1 duplicate frame(s)!
Pos:  12.9s    299f ( 0%)  56fps Trem:  47min 181mb  A-V:0.000 [156:55]
1 duplicate frame(s)!
Pos:  13.5s    313f ( 0%)  57fps Trem:  47min 179mb  A-V:0.000 [151:56]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
Pos:  13.8s    321f ( 0%)  57fps Trem:  48min 180mb  A-V:0.000 [148:56]
1 duplicate frame(s)!
Pos:  14.0s    324f ( 0%)  57fps Trem:  47min 179mb  A-V:0.000 [147:56]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.000 [147:56]
Pos:  14.2s    328f ( 0%)  57fps Trem:  48min 178mb  A-V:0.000 [146:56]
1 duplicate frame(s)!
Pos:  14.6s    337f ( 0%)  57fps Trem:  48min 177mb  A-V:0.000 [142:57]
1 duplicate frame(s)!
Pos:  14.8s    340f ( 0%)  57fps Trem:  48min 178mb  A-V:0.000 [141:57]
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
Pos:  14.9s    343f ( 0%)  58fps Trem:  48min 179mb  A-V:0.000 [141:57]
1 duplicate frame(s)!
Pos:  16.0s    369f ( 0%)  58fps Trem:  49min 182mb  A-V:0.000 [135:58]
1 duplicate frame(s)!
Pos:6392.2s 153243f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23.976 -> 29.970  (-5.994000) [4]  :0.000 [578:76]
Pos:6392.5s 153250f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6392.7s 153255f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6393.0s 153260f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6393.2s 153265f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6393.5s 153270f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6393.7s 153275f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6394.0s 153280f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6394.2s 153285f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6394.5s 153290f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6394.7s 153295f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [578:76]
1 duplicate frame(s)!
Pos:6395.0s 153300f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6395.2s 153305f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6395.5s 153310f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6395.7s 153315f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6396.0s 153320f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6396.2s 153325f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6396.5s 153330f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
Pos:6396.7s 153334f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
1 duplicate frame(s)!
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)577:76]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
videocodec: libavcodec (528x224 fourcc=58564944 [DIVX])
Using constant qscale = 5.000000 (VBR)
Could not open codec.
FATAL: Cannot initialize video driver.
Pos:6396.8s 153336f (99%)  46fps Trem:   0min 502mb  A-V:0.000 [577:76]
Writing AVI index...
Fixing AVI header...

Video stream:  577.837 kbit/s  (72229 bps)  size: 462036214 bytes  6396.772 secs                                                                              153336 frames

Audio stream:   76.363 kbit/s  (9545 bps)  size: 61064496 bytes  6397.272 secs


More information about the MPlayer-users mailing list