[MPlayer-users] Help with strange desync on mplayer file

Andrew Worsley Andrew.Worsley at ericsson.com.au
Fri Sep 20 03:46:01 CEST 2002


 I have an avi file - actually generated by mplayer via -oac copy -ovc copy
 in order to shorten the file. 

 The original and the shorten version plays fine.

 But 3 pass re-encoding (to make a smaller file for writing to a CD)
 generates a desync of a 1 or 2 seconds.

 But a sample done via a 2 pass encoding generated a version with out trouble
 (except it was too big because the audio was at a higher rate).

 I enclose lots of boring diagnostics from playing all the files, the diff of
 the mplayer -v output -frames 0 on the two files and the full version of the
 bad headers. The output for the shrunk files can be sent if needed but this
 is quite large enough.

  The encoding options where:

 3 pass commands:

 rm -f frameno.avi lavc_stats.txt
 mencoder -v -ovc frameno -oac mp3lame -lameopts vbr=3:br=96 -o frameno.avi G.avi
 mencoder -v -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=858:vpass=1 -oac copy -o movie.avi G.avi
 mencoder -v -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=858:vpass=2 -oac copy -o movie.avi G.avi

 
 
 2 pass commands:
 mencoder -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=858:vpass=1 -oac mp3lame -o movie.avi G.avi
 mencoder -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=858:vpass=2 -oac mp3lame -o movie.avi G.avi


   Help appreciated.

   	Andrew

PS :
  An addition to the man page on explaining the vbr_mode's of lame (from my
  reading of the source):

  vbr=
      rh => old reliable/slow algorithm, 
      mtrh = new fast (not as tested) algorithm
      mt = obsolete now is the same as mtrh

    The others are obvious e.g. cbr, abr et cetera.

------------------------------------

 diff -u between the two headers when playing files:

 Good is + bad is mark with -
--- bad	Fri Sep 20 10:43:07 2002
+++ good Fri Sep 20 10:54:45 2002
@@ -7,7 +7,7 @@
 Compiled for x86 CPU with extensions: MMX MMX2 SSE
 
 Reading /root/.mplayer/codecs.conf: Reading /usr/local/etc/mplayer/codecs.conf: 38 audio & 106 video codecs
-CommandLine: '-vo' 'x11' '-ss' '5:00' '-idx' '-v' 'movie.avi' '-frames' '0'
+CommandLine: '-vo' 'x11' '-ss' '5:00' '-idx' '-v' 'x' '-frames' '0'
 get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
 font: can't open file: /root/.mplayer/font/font.desc
 Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
@@ -15,9 +15,9 @@
 Using Linux hardware RTC timing (1024Hz)
 get_path('input.conf') -> '/root/.mplayer/input.conf'
 
-Playing movie.avi
+Playing x
 Not an URL!
-File size is 250591570 bytes
+File size is 104857600 bytes
 Detected AVI file format!
 list_end=0x144
 ======= AVI Header =======
@@ -69,7 +69,7 @@
 Format Tag: 85 (0x55)
 Channels: 2
 Samplerate: 48000
-avg byte/sec: 10764
+avg byte/sec: 24000
 Block align: 1152
 bits/sample: 0
 cbSize: 12
@@ -84,12 +84,13 @@
 Broken chunk?  chunksize=1670  (id=JUNK)
 list_end=0x0
 Found movie at 0x80C - 0x0
-Generating Index:   1 %     
Generating Index:   2 %     
Generating Index:   3 %     
Generating Index:   4 %     
Generating Index:   5 %     
AVI: Generated index table for 144152 chunks!
-AVI index offset: 0x0 (movi=0x80C idx0=0x80C idx1=0x964)
+Generating Index:   1 %     
Generating Index:   2 %     
stream_seek: WARNING! Can't seek to 0x6400D2A !
+AVI: Generated index table for 59760 chunks!
+AVI index offset: 0x0 (movi=0x80C idx0=0x80C idx1=0x934)
 Auto-selected AVI audio ID = 1
 Auto-selected AVI video ID = 0
 AVI: Searching for audio stream (id:1)
-AVI video length=4293812020
+AVI video length=4294487156
 VIDEO:  [DIVX]  0x0  24bpp  29.97 fps  -17179870.0 kbps (-2097152.0 kbyte/s)
 [V] filefmt:3  fourcc:0x58564944  size:0x0  fps:29.97  ftime:=0.0334
 Clip info: 
@@ -103,9 +104,9 @@
 mp3lib: made decode tables with MMX optimization
 init layer2&3 finished, tables done
 mp3lib: using MMX optimized decore!
-
MPEG 1.0, Layer III, 48000 Hz 112 kbit Joint-Stereo, BPF: 336
+
MPEG 1.0, Layer III, 48000 Hz 96 kbit Stereo, BPF: 288
 Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0
-AUDIO: 48000 Hz, 2 ch, sfmt: 0x10 (2 bps), ratio: 14000->192000 (112.0 kbit)
+AUDIO: 48000 Hz, 2 ch, sfmt: 0x10 (2 bps), ratio: 12000->192000 (96.0 kbit)
 X11 opening display: :1.0
 vo: X11 color mask:  FFFFFF  (R:FF0000 G:FF00 B:FF)
 vo: X11 running at 1600x1200 with depth 24 and 32 bpp (":1.0" => local display)

-------------------------------------------------

Full version of desynced - 3 pass version:


MPlayer 0.90pre8-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS)

CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville (Family: 6, Stepping: 6)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE

Reading /root/.mplayer/codecs.conf: Reading /usr/local/etc/mplayer/codecs.conf: 38 audio & 106 video codecs
CommandLine: '-vo' 'x11' '-ss' '5:00' '-idx' '-v' 'movie.avi' '-frames' '0'
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
font: can't open file: /root/.mplayer/font/font.desc
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
Using Linux hardware RTC timing (1024Hz)
get_path('input.conf') -> '/root/.mplayer/input.conf'

Playing movie.avi
Not an URL!
File size is 250591570 bytes
Detected AVI file format!
list_end=0x144
======= AVI Header =======
us/frame: 33366  (fps=29.971)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (2304) IS_INTERLEAVED TRUST_CKTYPE
frames  total: 0   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  0 x 0
list_end=0xD4
==> Found video stream: 0
======= STREAM Header =======
Type: vids   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 299699/10000 = 29.970
Start: 0   Len: 0
Suggested BufferSize: 0
Quality 0
Sample size: 0
found 'bih', 40 bytes of 40
======= VIDEO Format ======
  biSize 40
  biWidth 0
  biHeight 0
  biPlanes 1
  biBitCount 24
  biCompression 1482049860='DIVX'
  biSizeImage 0
===========================
Regenerating keyframe table for DIVX 4 video
list_end=0x144
==> Found audio stream: 1
======= STREAM Header =======
Type: auds   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 48000/1152 = 41.667
Start: 0   Len: 0
Suggested BufferSize: 0
Quality 0
Sample size: 0
found 'wf', 28 bytes of 18
======= WAVE Format =======
Format Tag: 85 (0x55)
Channels: 2
Samplerate: 48000
avg byte/sec: 10764
Block align: 1152
bits/sample: 0
cbSize: 12
mp3.wID=1
mp3.fdwFlags=0x2
mp3.nBlockSize=1152
mp3.nFramesPerBlock=1
mp3.nCodecDelay=753
list_end=0x172
hdr=Software  size=26
Software  : MEncoder 0.90pre8-2.95.3 
Broken chunk?  chunksize=1670  (id=JUNK)
list_end=0x0
Found movie at 0x80C - 0x0
Generating Index:   1 %     
Generating Index:   2 %     
Generating Index:   3 %     
Generating Index:   4 %     
Generating Index:   5 %     
AVI: Generated index table for 144152 chunks!
AVI index offset: 0x0 (movi=0x80C idx0=0x80C idx1=0x964)
Auto-selected AVI audio ID = 1
Auto-selected AVI video ID = 0
AVI: Searching for audio stream (id:1)
AVI video length=4293812020
VIDEO:  [DIVX]  0x0  24bpp  29.97 fps  -17179870.0 kbps (-2097152.0 kbyte/s)
[V] filefmt:3  fourcc:0x58564944  size:0x0  fps:29.97  ftime:=0.0334
Clip info: 
 Software: MEncoder 0.90pre8-2.95.3 
get_path('sub/') -> '/root/.mplayer/sub/'
==========================================================================
Detected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
Initializing audio codec...
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer
mp3lib: made decode tables with MMX optimization
init layer2&3 finished, tables done
mp3lib: using MMX optimized decore!

MPEG 1.0, Layer III, 48000 Hz 112 kbit Joint-Stereo, BPF: 336
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0
AUDIO: 48000 Hz, 2 ch, sfmt: 0x10 (2 bps), ratio: 14000->192000 (112.0 kbit)
X11 opening display: :1.0
vo: X11 color mask:  FFFFFF  (R:FF0000 G:FF00 B:FF)
vo: X11 running at 1600x1200 with depth 24 and 32 bpp (":1.0" => local display)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
INFO: libavcodec init OK!
Detected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
AO: [oss] 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
ao2: 48000 Hz  2 chans  Signed 16-bit (Little-Endian)
audio_setup: using '/dev/dsp' dsp device
audio_setup: sample format: Signed 16-bit (Little-Endian) (requested: Signed 16-bit (Little-Endian))
audio_setup: using 2 channels (requested: 2)
audio_setup: using 48000 Hz samplerate (requested: 48000)
audio_setup: frags:  32/32  (1024 bytes/frag)  free:  32768
Start playing...

DEMUXER: freeing demuxer at 0x83567a8  
vo: uninit ...

Exiting... (End of file)




More information about the MPlayer-users mailing list