[MPlayer-dev-eng] problem in nuv demuxer?

D Richard Felker III dalias at aerifal.cx
Tue Jul 23 18:47:08 CEST 2002


After experimenting with tons of live tv capture programs, the only
one I've found that remotely works is NuppelVideo's nuvrec. However,
with -r (raw) it takes way too much disk space (not to mention disk
bandwidth) to be usable, and the output of the RTjpeg codec is hideous
even with -Q 255 -- certainly not suitable for reencoding with mpeg4.
So, I tried the following experiment:

mkfifo test.nuv
nuvrec -n -S 1 -W 320 -H 240 -r test

mencoder test.nuv -oac pcm -lavcopts vcodec=mjpeg:vqscale=2

Capturing like this works beautifully for ten seconds or so, but then
mencoder always seems to crash. The problem seems to be that
ds_read_packet is allocating a packet of length 0 and then trying to
memcpy to its buffer. The crash is in an inline function from
stream.h:

141         memcpy(mem,&s->buffer[s->buf_pos],x);

I imagine the problem is that the nuv demuxer doesn't know how to deal
with the case where it only reads a partial packet because the rest
hasn't made it through the pipe yet, but this is just a guess.

Apologies for posting this to the dev list if it's inappropriate (let
me know if that's the case). I'm interested in helping to fix this
though, if I can figure out how all this stuff works, so I figure it's
at least somewhat relevant here.


Rich

-------------- next part --------------
brightrain:~$ gdb ~/src/mplayer/mencoder
GNU gdb 4.18
Copyright 1998 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 "i586-pc-linux-gnu"...
(gdb) run test.nuv -oac pcm -lavcopts vcodec=mjpeg:vqscale=2
Starting program: /home/dalias/src/mplayer/mencoder test.nuv -oac pcm -lavcopts vcodec=mjpeg:vqscale=2


MEncoder CVS-020713-20:27-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPU: Advanced Micro Devices K6-2 (Family: 5, Stepping: 12)
CPUflags: Type: 5 MMX: 1 MMX2: 0 3DNow: 1 3DNow2: 0 SSE: 0 SSE2: 0
Reading /home/dalias/.mplayer/codecs.conf: can't open '/home/dalias/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/share/mplayer/codecs.conf: 36 audio & 103 video codecs
File not found: 'frameno.avi'
/home/dalias/.mplayer/mencoder(1): option: ni
/home/dalias/.mplayer/mencoder(1): parameter: 1
/home/dalias/.mplayer/mencoder(2): option: lavcopts
/home/dalias/.mplayer/mencoder(2): parameter: vcodec=mpeg4:vqmin=2:vrc_strategy=1
/home/dalias/.mplayer/mencoder(3): option: lameopts
/home/dalias/.mplayer/mencoder(3): parameter: aq=2
/home/dalias/.mplayer/mencoder(4): option: tv
/home/dalias/.mplayer/mencoder(4): parameter: chanlist=us-bcast:norm=ntsc:driver=v4l:input=1:width=320:height=240:outfmt=i420
font: can't open file: /home/dalias/.mplayer/font/font.desc
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 chars)
success: format: 0  data: 0x0 - 0x0
Detected NuppelVideo file format!
[V] filefmt:13  fourcc:0x3156554E  size:320x240  fps:29.97  ftime:=0.0334
Detected audio codec: [pcm] drv:2 (Uncompressed PCM)
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: srate=44100  chans=2  bps=2  sfmt=0x10  ratio: 176400->176400
libavcodec: CPU flags: mmx 3dnow
Opening video filter: [expand=-1:-1:-1:-1:1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [nuv] NuppelVideo decoder
VDec: vo config request - 320 x 240 (preferred csp: Planar I420)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
videocodec: libavcodec (320x240 fourcc=47504a4d [MJPG])
Using constant qscale = 2 (VBR)
Detected video codec: [nuv] drv:15 (NuppelVideo)
==========================================================================
CBR PCM audio selected
Writing AVI header...
Pos:   0.7s     22f ( 0%)   9fps Trem:   0min   0mb  A-V:-0.070 [0:1411]
duplicate 1 frame(s)!!!
Pos:   1.1s     33f ( 0%)  11fps Trem:   0min   0mb  A-V:-0.068 [6255:1411]
duplicate 1 frame(s)!!!
Pos:  11.5s    343f ( 0%)  25fps Trem:   0min   0mb  A-V:-0.053 [6577:1411]
Program received signal SIGSEGV, Segmentation fault.
0x401cee97 in memcpy () from /lib/libc.so.6
(gdb) bt
#0  0x401cee97 in memcpy () from /lib/libc.so.6
#1  0x80f58d2 in ds_read_packet (ds=0x824b570, stream=0x8249420, len=522266171, pts=874913.312, pos=42752316, flags=0)
    at ../libmpdemux/stream.h:141
#2  0x81050fc in demux_nuv_fill_buffer (demuxer=0x824aca0) at demux_nuv.c:176
#3  0x80f5af9 in demux_fill_buffer (demux=0x824aca0, ds=0x824b508) at demuxer.c:283
#4  0x80f5d21 in ds_fill_buffer (ds=0x824b508) at demuxer.c:342
#5  0x80f5dc6 in demux_read_data (ds=0x824b508, mem=0x82723a0 "?", len=65536) at demuxer.c:361
#6  0x8063e18 in decode_audio (sh_audio=0x824b718, buf=0x82723a0 "?", minlen=65536, maxlen=67584) at ad_pcm.c:69
#7  0x8061f14 in decode_audio (sh_audio=0x824b718, buf=0x82723a0 "?", minlen=65536, maxlen=67584) at dec_audio.c:130
#8  0x804b294 in dec_audio (sh_audio=0x824b718,
    buffer=0x40725008 "?\a\\\006\223\au\006L\ah\006\031\a%\006?\006?\005\227\006?\005\e\006?\005\215\005\202\005\r\005;\005\234\004?\0046\004\237\004\006\004h\004?\003O\004\037\004+\004\177\004\013\004?\004\005\004;\005\034\004~\005,\004?\005\013\004\236\005?\003{\005?\003c\005\216\0035\005I\003?\004?\002?\003h\002-\003?\001?\002f\001\234\002?", total=88200) at mencoder.c:262
#9  0x804cbe1 in main (argc=6, argv=0xbffffc04, envp=0xbffffc20) at mencoder.c:878
(gdb)


More information about the MPlayer-dev-eng mailing list