[MPlayer-users] bug report encoding mjpeg to divx

Matt Anderson mda2376 at osfmail.isc.rit.edu
Tue Jul 30 16:10:03 CEST 2002


Hello,
Using mjpeg tools capturing from a matrox g400 and matrox g200 the output avi 
files cause a segfault a few frames into encoding.  I suspect this has 
somethign to do with the sound- I tried seperating the input file into just a 
video.avi and sound.wav file.  Encoding just the video.avi worked properly 
(but without sound unfortunatly), but when adding -audiofile sound.wav the 
crash reoccurs.  

I have tried encoding from a dvd (mencoder -dvd 1 -ovc divx4 -oac mp3lame -
divx4opts br=1200:q=5 -o dvd.avi) and it worked properly, if that is relevant

Thinking this had something to do with the compiler, I've tried gcc 2.95.3, 
2.96.110 and gcc 3.0.4 (all on seperate installations of linux)

My report is as follows:

Linux distribution: RedHat 7.3 
Kernel version: 2.4.18-3smp #1 SMP Thu Apr 18 07:27:31 EDT 2002 i686 unknown
Libc version: libc-2.2.5.so
X version: XFree86 Version 4.2.0 (Red Hat Linux release: 4.2.0-8)
GCC version: 3.0.4
ld version: GNU ld version 2.11.93.0.2 20020207
as version: GNU assembler 2.11.93.0.2 20020207

CPU Info: 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 10
cpu MHz         : 998.375
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 mmx fxsr sse
bogomips        : 1992.29
 
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 10
cpu MHz         : 998.375
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 mmx fxsr sse
bogomips        : 1992.29

Video Card: Matrox G400-tv 16mb (also matrox g200-tv 16mb)
Video Driver: X built in (I havent played with this)
Sound Card: Creative SoundBlaster Live Value w/kernel driver

Mencoder output at verbosity 1:

MEncoder CVS-020730-07:09-3.0.4 (C) 2000-2002 Arpad Gereoffy (see DOCS!)
 
CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville (Family: 6, Stepping: 
10)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Reading /root/.mplayer/codecs.conf: can't open '/root/.mplayer/codecs.conf': 
No such f$
Reading /usr/local/share/mplayer/codecs.conf: 36 audio & 103 video codecs
File not found: 'frameno.avi'
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
font: can't open file: /root/.mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
Not an URL!
File size is 8388608 bytes
Detected AVI file format!
success: format: 0  data: 0x0 - 0x800000
list_end=0x148
list_end=0xDC
======= AVI Header =======
us/frame: 33367  (fps=29.970)
max bytes/sec: 10000000
padding: 0
MainAVIHeader.dwFlags: (65584) HAS_INDEX MUST_USE_INDEX WAS_CAPTUREFILE
frames  total: 4196   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  720 x 480 
==> Found video stream: 0
found 'bih', 40 bytes of 40
======= STREAM Header =======
Type: vids   FCC: MJPG (47504A4D)
Flags: 0 
Priority: 0   Language: 0 
InitialFrames: 0 
Rate: 1000000/33367 = 29.970
Start: 0   Len: 4196 
Suggested BufferSize: 0   
Quality -1 
Sample size: 0 
list_end=0x148
======= VIDEO Format ======
  biSize 40 
  biWidth 720 
  biHeight 480 
  biPlanes 1 
  biBitCount 24
  biCompression 1196444237='MJPG'
  biSizeImage 345600 
===========================
==> Found audio stream: 1
found 'wf', 16 bytes of 20
======= STREAM Header =======
Type: auds   FCC:  (0)
Flags: 0 
Priority: 0   Language: 0
InitialFrames: 0
Rate: 176400/4 = 44100.000
Start: 0   Len: 6174288 
Suggested BufferSize: 0 
Quality -1 
Sample size: 4 
Broken chunk?  chunksize=1700  (id=JUNK)
======= WAVE Format ======= 
Format Tag: 1 (0x1) 
Channels: 2 
Samplerate: 44100 
avg byte/sec: 176400
Block align: 4
bits/sample: 16
cbSize: 0    
list_end=0x2468742E
Found movie at 0x800 - 0x2468742E
stream_seek: WARNING! Can't seek to 0x2468742E !
Auto-selected AVI video ID = 0
AVI: Searching for audio stream (id:-1)
Auto-selected AVI audio ID = 1
XXX initial  v_pts=0.000  a_pos=0 (0.000)
AVI video length=604648926
VIDEO:  [MJPG]  720x480  24bpp  29.97 fps  34549.4 kbps (4217.5 kbyte/s)
[V] filefmt:3  fourcc:0x47504A4D  size:720x480  fps:29.97  ftime:=0.0334
Detected audio codec: [pcm] drv:2 (Uncompressed PCM)
Initializing audio codec...
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer
AUDIO: srate=44100  chans=2  bps=2  sfmt=0x10  ratio: 176400->176400
Opening video filter: [expand=-1:-1:-1:-1:1]
==========================================================================
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video decoder: [vfw] Win32/VfW video codecs
VDec: vo config request - 720 x 480 (preferred csp: Packed YUY2)
[PP] Using codec's postprocessing, max q = 9
vo_debug: query(Packed YUY2) returned 0x401 (i=0)
vo_debug: query(Packed UYVY) returned 0x401 (i=1)
vo_debug: query(BGR 32-bit) returned 0x0 (i=2)
vo_debug: query(BGR 24-bit) returned 0x601 (i=3)
vo_debug: query(BGR 15-bit) returned 0x0 (i=4)
Movie-Aspect is undefined - no prescaling applied.
video_out->init(720x480->720x480,flags=0,'MPlayer',0x32595559)
REQ: flags=0x1  req=0x0 
======= Win32 (VFW) VIDEO Codec init =======
get_path('registry') -> '/root/.mplayer/registry'
Loading DLL: 'm3jpeg32.dll' 
ICDecompressGetFormat OK  
ICDecompressGetFormatSize ret: 40 
ICDecompressQuery OK 
Starting decompression, format: 
  biSize 40 
  biWidth 720 
  biHeight 480 
  biPlanes 1 
  biBitCount 24 
  biCompression 0x47504a4d ('MJPG') 
  biSizeImage 345600 
Dest fmt: 
  biSize 40 
  biWidth 720 
  biHeight -480 
  biPlanes 1 
  biBitCount 16 
  biCompression 0x32595559 ('YUY2') 
  biSizeImage 691200 
ICDecompressBegin failed: Error -2 
VIDEO CODEC Init OK!!! ;-) 
Called unk_MessageBeep  
Called unk_GetActiveWindow 
Called unk_DialogBoxParamA 
INFO: Win32 video codec init OK!
Detected video codec: [m3jpeg] drv:2 (Morgan Motion JPEG Codec)
==========================================================================
LAME version 3.92  (http://www.mp3dev.org/)
Using polyphase lowpass  filter, transition band: 15115 Hz - 15648 Hz
   
misc: 
   
        scaling: 0.000000
        ch0 (left) scaling: 0.000000
        ch1 (right) scaling: 0.000000
        filter type: 0
        quantization: ISO
        huffman search: normal
        experimental X=0 Y=0 Z=0
        ... 
   
stream format:  
   
        MPEG-1 Layer 3
        2 channel - joint stereo   
        padding: auto 
        constant bitrate - CBR
        ... 
 
psychoacoustic: 
 
        tonality estimation limit: 8871.700195 Hz 
        using short blocks: channel coupled
        adjust masking: 0.000000 dB 
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0   
        ATH: using 
         ^ type: 2 
         ^ adjust type: 0
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        experimental X=0 Y=0 Z=0
        ... 
   
stream format:  
   
        MPEG-1 Layer 3
        2 channel - joint stereo   
        padding: auto 
        constant bitrate - CBR
        ... 
 
psychoacoustic: 
 
        tonality estimation limit: 8871.700195 Hz 
        using short blocks: channel coupled
        adjust masking: 0.000000 dB 
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0   
        ATH: using 
         ^ type: 2 
         ^ adjust type: 0
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        experimental X=0 Y=0 Z=0
        ... 
   
stream format:  
   
        MPEG-1 Layer 3
        2 channel - joint stereo   
        padding: auto 
        constant bitrate - CBR
        ... 
 
psychoacoustic: 
 
        tonality estimation limit: 8871.700195 Hz 
        using short blocks: channel coupled
        adjust masking: 0.000000 dB 
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0   
        ATH: using 
         ^ type: 2 
         ^ adjust type: 0
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        experimental X=0 Y=0 Z=0
        ... 
   
stream format:  
   
        MPEG-1 Layer 3
        2 channel - joint stereo   
        padding: auto 
        constant bitrate - CBR
        ... 
 
psychoacoustic: 
 
        tonality estimation limit: 8871.700195 Hz 
        using short blocks: channel coupled
        adjust masking: 0.000000 dB 
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0   
        ATH: using 
         ^ type: 2 
         ^ adjust type: 0
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        experimental X=0 Y=0 Z=0
        ... 
   
stream format:  
   
        MPEG-1 Layer 3
        2 channel - joint stereo   
        padding: auto 
        constant bitrate - CBR
        ... 
 
psychoacoustic: 
 
        tonality estimation limit: 8871.700195 Hz 
        using short blocks: channel coupled
        adjust masking: 0.000000 dB 
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0   
        ATH: using 
         ^ type: 2 
         ^ adjust type: 0
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        interchannel masking ratio: 0.000000
        ... 
   
*** [divx4] Allocating mp_image_t, 720x480x16bpp YUV packed, 691200 bytes
MP3 audio selected
Writing AVI header... 
*** [expand] Direct Rendering mp_image_t, 720x480x16bpp YUV packed, 691200 
bytes
Pos:   0.0s      1f ( 0%)   0fps Trem:   0min  13mb  A-V:0.000 [0:0] A/Vms 
5/30 D/S 0/0
Pos:   0.1s      2f ( 0%)   0fps Trem:   0min  18mb  A-V:0.003 [0:0] A/Vms 
4/47 D/S 0/0
Pos:   0.1s      3f ( 0%)   0fps Trem:   1min  20mb  A-V:0.007 [0:0] A/Vms 
4/53 D/S 0/0
Pos:   0.1s      4f ( 0%)   0fps Trem:   1min  22mb  A-V:0.010 [0:0] A/Vms 
4/57 D/S 0/0
Pos:   0.2s      5f ( 0%)   0fps Trem:   1min  23mb  A-V:0.013 [0:0] A/Vms 
4/59 D/S 0/0
Pos:   0.2s      6f ( 0%)   0fps Trem:   1min  23mb  A-V:0.017 [0:0] A/Vms 
4/60 D/S 0/0
Pos:   0.2s      7f ( 0%)   0fps Trem:   1min  24mb  A-V:0.020 [0:0] A/Vms 
4/61 D/S 0/0
Pos:   0.3s      8f ( 0%)   0fps Trem:   2min  23mb  A-V:0.023 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.3s      9f ( 0%)   0fps Trem:   2min  22mb  A-V:0.027 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.3s     10f ( 0%)   0fps Trem:   2min  23mb  A-V:0.030 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.4s     11f ( 0%)   0fps Trem:   2min  23mb  A-V:0.033 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.4s     12f ( 0%)   0fps Trem:   2min  22mb  A-V:0.037 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.4s     13f ( 0%)  12fps Trem:   2min  22mb  A-V:0.040 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.5s     14f ( 0%)  12fps Trem:   2min  21mb  A-V:0.043 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.5s     15f ( 0%)  12fps Trem:   2min  22mb  A-V:0.046 [0:0] A/Vms 
4/62 D/S 0/0
Pos:   0.5s     16f ( 0%)  12fps Trem:   2min  20mb  A-V:0.049 [0:127] A/Vms 
4/62 D/S 0
Pos:   0.6s     17f ( 0%)  12fps Trem:   2min  20mb  A-V:0.052 [0:127] A/Vms 
4/62 D/S 0
Pos:   0.6s     18f ( 0%)  13fps Trem:   2min  20mb  A-V:0.056 [0:127] A/Vms 
4/62 D/S 0
Pos:   0.6s     19f ( 0%)  13fps Trem:   2min  19mb  A-V:0.059 [0:127] A/Vms 
4/62 D/S 0
Pos:   0.7s     20f ( 0%)  13fps Trem:   2min  19mb  A-V:0.062 [0:127] A/Vms 
4/62 D/S 0
Pos:   0.7s     21f ( 0%)  13fps Trem:   2min  19mb  A-V:0.066 [0:127] A/Vms 
4/62 D/S 0
Pos:   0.7s     22f ( 0%)  13fps Trem:   2min  18mb  A-V:0.069 [0:127] A/Vms 
4/62 D/S 0

(sorry about format, mencoder.log is in the tar)

gdb / disass output:

(gdb) disass $eip-32 $eip+32
Dump of assembler code from 0x100021f5 to 0x10002235:
0x100021f5:     (bad)  
0x100021f6:     paddsw %mm6,%mm3
0x100021f9:     packuswb %mm2,%mm2
0x100021fc:     packuswb %mm3,%mm3
0x100021ff:     movq   (%ecx),%mm0
0x10002202:     movq   0x8(%ecx),%mm1
0x10002206:     packuswb %mm1,%mm0
0x10002209:     punpcklbw %mm3,%mm2
0x1000220c:     movq   %mm0,%mm4
0x1000220f:     punpcklbw %mm2,%mm0
0x10002212:     punpckhbw %mm2,%mm4
0x10002215:     movq   %mm0,(%edx)
0x10002218:     movq   %mm4,0x8(%edx)
0x1000221c:     add    %ebx,%edx
0x1000221e:     movq   %mm7,(%ecx)
0x10002221:     movq   %mm7,0x8(%ecx)
0x10002225:     add    $0x10,%ecx
0x10002228:     movq   %mm7,(%eax)
0x1000222b:     movq   %mm7,0x80(%eax)
0x10002232:     add    $0x10,%eax
End of assembler dump.


Thanks!

Matt Anderson
mda2376 at rit.edu


A copy of this has been uploaded to 
ftp://mplayerhq.hu/MPlayer/incomming/bug_encoder_mjpeg.tar.gz along with a 8mb 
(the crash did not occur in a 5mb) avi file




More information about the MPlayer-users mailing list