[MEncoder-users] Segfault when using v4l2 input with full-feature DVB card

Gavin Hamill gdh at acentral.co.uk
Wed Dec 28 21:23:01 CET 2005


Hi again :)

I have a full-feature (onboard MPEG2 decoder + TV out) DVB card which
provides a v4l2 /dev/video device. When I capture using driver=v4l, it
works, but I would prefer to use the native v4l2 support, but mencoder
segfaults.

telly:~/mplayer/main# gdb ./mencoder
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-linux"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) run -v -nosound -tv driver=v4l2:width=640:height=480 tv:// -o
tv.avi -ovc lavc
Starting program: /root/mplayer/main/mencoder -v -nosound -tv
driver=v4l2:width=640:height=480 tv:// -o tv.avi -ovc lavc
[Thread debugging using libthread_db enabled]
[New Thread -1215324032 (LWP 32593)]
Using GNU internationalization
Original domain: messages
Original dirname: /usr/share/locale
Current domain: mplayer
Current dirname: /usr/local/share/locale

MEncoder dev-CVS-051228-19:21-3.3.5 (C) 2000-2005 MPlayer Team
CPU: IDT/Centaur/VIA C3 Samuel 2 (WinChip C5B core)/C3 Ezra (Family: 6,
Stepping: 3)
CPUflags: Type: 6 MMX: 1 MMX2: 0 3DNow: 1 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX 3DNow

init_freetype
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
font: can't open file: /root/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay
STREAM: [null] tv://
STREAM: Description: Null stream
STREAM: Author: Albeu
STREAM: Comment:
success: format: 9  data: 0x0 - 0x0
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: dvb
 Capabilites:  video capture  video overlay  read/write  streaming
 supported norms: 0 = PAL; 1 = NTSC;
 inputs: 0 = DVB;
 Current input: 0
 Format RGB332 ( 8 bits, RGB-8 (3-3-2)): RGB 8-bit
 Format RGB565 (16 bits, RGB-16 (5/B-6/G-5/R)): BGR 16-bit
 Format BGR24  (24 bits, RGB-24 (B-G-R)): BGR 24-bit
 Format BGR32  (32 bits, RGB-32 (B-G-R)): BGRA
 Format RGB32  (32 bits, RGB-32 (R-G-B)): RGBA
 Format GREY   ( 8 bits, Greyscale-8): Planar Y800
 Format YUV422P (16 bits, YUV 4:2:2 planar (Y-Cb-Cr)): Planar 422P
 Format YVU420 (12 bits, YVU 4:2:0 planar (Y-Cb-Cr)): Planar YV12
 Format YUV420 (12 bits, YUV 4:2:0 planar (Y-Cb-Cr)): Planar I420
 Format UYVY   (16 bits, YUV 4:2:2 (U-Y-V-Y)): Packed UYVY
 Current format: BGR24
v4l2: set format: YVU420
v4l2: set input: 0
Selected norm: pal
v4l2: set norm: PAL
v4l2: set width: 640
v4l2: set height: 480
Selected input hasn't got a tuner!
==> Found video stream: 0
v4l2: get format: YVU420
v4l2: get fps: 25.000000
v4l2: get width: 640
v4l2: get height: 480
Using a ring buffer for maximum 267 frames, 117 MB total size.
v4l2: ioctl set mute failed: Invalid argument
v4l2: set Brightness: 128 [0, 255]
v4l2: ioctl query control failed: Invalid argument
v4l2: set Saturation: 64 [0, 127]
v4l2: set Contrast: 64 [0, 127]
[V] filefmt:9  fourcc:0x32315659  size:640x480  fps:25.00  ftime:=0.0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
Trying filter chain: expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (640x480->640x480,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (640x480 fourcc=34504d46 [FMP4])
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Forcing audio preload to 0, max pts correction to 0
[New Thread -1224123472 (LWP 32596)]
v4l2: going to capture

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215324032 (LWP 32593)]
0xb799607f in memcpy () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb799607f in memcpy () from /lib/tls/libc.so.6
#1  0x080d1b11 in grab_video_frame (priv=0xb6896000, buffer=0xb7096008
'\020' <repeats 200 times>...,
    len=921600) at tvi_v4l2.c:1554
#2  0x080cc628 in demux_tv_fill_buffer (demux=0x86298d8, ds=0xb7107000)
at tv.c:121
#3  0x080d7503 in demux_fill_buffer (demux=0xe1000, ds=0x862a1b0) at
demuxer.c:332
#4  0x080d75e7 in ds_fill_buffer (ds=0x862a1b0) at demuxer.c:381
#5  0x080d79e9 in ds_get_packet (ds=0x862a1b0, start=0xbfda3dd0) at
demuxer.c:455
#6  0x080c904d in video_read_frame (sh_video=0x862a660,
frame_time_ptr=0xbfda3dd8, start=0xbfda3dd0,
    force_fps=0) at video.c:578
#7  0x08052a83 in main (argc=10, argv=0xbfda3e84) at mencoder.c:1240
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0xb799605f to 0xb799609f:
0xb799605f <memcpy+15>: mov    %edi,0x4(%esp)
0xb7996063 <memcpy+19>: mov    0xc(%ebp),%esi
0xb7996066 <memcpy+22>: cmp    $0x7,%eax
0xb7996069 <memcpy+25>: mov    %edx,%edi
0xb799606b <memcpy+27>: jbe    0xb7996084 <memcpy+52>
0xb799606d <memcpy+29>: mov    %edx,%ecx
0xb799606f <memcpy+31>: neg    %ecx
0xb7996071 <memcpy+33>: and    $0x3,%ecx
0xb7996074 <memcpy+36>: sub    %ecx,%eax
0xb7996076 <memcpy+38>: cld
0xb7996077 <memcpy+39>: repz movsb %ds:(%esi),%es:(%edi)
0xb7996079 <memcpy+41>: mov    %eax,%ecx
0xb799607b <memcpy+43>: shr    $0x2,%ecx
0xb799607e <memcpy+46>: cld
0xb799607f <memcpy+47>: repz movsl %ds:(%esi),%es:(%edi)
0xb7996081 <memcpy+49>: and    $0x3,%eax
0xb7996084 <memcpy+52>: mov    %eax,%ecx
0xb7996086 <memcpy+54>: cld
0xb7996087 <memcpy+55>: repz movsb %ds:(%esi),%es:(%edi)
0xb7996089 <memcpy+57>: mov    (%esp),%esi
0xb799608c <memcpy+60>: mov    %edx,%eax
0xb799608e <memcpy+62>: mov    0x4(%esp),%edi
0xb7996092 <memcpy+66>: mov    %ebp,%esp
0xb7996094 <memcpy+68>: pop    %ebp
0xb7996095 <memcpy+69>: ret
0xb7996096 <memcpy+70>: nop
0xb7996097 <memcpy+71>: nop
0xb7996098 <memcpy+72>: nop
0xb7996099 <memcpy+73>: nop
0xb799609a <memcpy+74>: nop
0xb799609b <memcpy+75>: nop
0xb799609c <memcpy+76>: nop
0xb799609d <memcpy+77>: nop
0xb799609e <memcpy+78>: nop
---Type <return> to continue, or q <return> to quit---
End of assembler dump.
(gdb) info all-registers
eax            0xe1000  921600
ecx            0x1c002  114690
edx            0xb7096008       -1224122360
ebx            0x862a53c        140682556
esp            0xbfda3a40       0xbfda3a40
ebp            0xbfda3a48       0xbfda3a48
esi            0xb6896000       -1232510976
edi            0xb7107000       -1223659520
eip            0xb799607f       0xb799607f
eflags         0x10216  66070
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
st0            0        (raw 0x00000000000000000000)
st1            0        (raw 0x00000000000000000000)
st2            0        (raw 0x00000000000000000000)
st3            0        (raw 0x00000000000000000000)
st4            1        (raw 0x3fff8000000000000000)
st5            590      (raw 0x40089380000000000000)
st6            0        (raw 0x00000000000000000000)
st7            0        (raw 0x00000000000000000000)
fctrl          0x37f    895
fstat          0x4020   16416
ftag           0xffff   65535
fiseg          0x73     115
fioff          0x80d1b09        135076617
foseg          0x7b     123
fooff          0xbfda3a68       -1076217240
fop            0x55d    1373
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
---Type <return> to continue, or q <return> to quit---
xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 <repeats 16 times>},
  v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
mxcsr          0x1f80   8064
mm0            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm1            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm2            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm3            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm4            {uint64 = 0x8000000000000000, v2_int32 = {0x0,
0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000},
  v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80}}
mm5            {uint64 = 0x9380000000000000, v2_int32 = {0x0,
0x93800000}, v4_int16 = {0x0, 0x0, 0x0, 0x9380},
  v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x93}}
mm6            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0,
---Type <return> to continue, or q <return> to quit---
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm7            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}


I notice the "Forcing audio preload to 0, max pts correction to 0" -
should this even be displayed since I specified '-nosound' on the
commandline?

Cheers,
Gavin.





More information about the MEncoder-users mailing list