v4l grabbing: standalone ffmpeg works, but streaming through ffserver fails
Hello everybody, I use the latest ffmpeg from Debian/unstable: ffmpeg version CVS, build 3211265, Copyright (c) 2000-2004 Fabrice Bellard configuration: --build i486-linux-gnu --enable-gpl --enable-pp --enable-zlib --enable-vorbis --enable-libogg --enable-theora --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --prefix=/usr built on Aug 22 2005 20:00:15, gcc: 4.0.2 20050816 (prerelease) (Debian 4.0.1-5) which is the CVS version from 20050811, on Linux 2.6.13. By USB 1.0, a Logitech QuickCam Pro 4000 is connected and visible through /dev/video0 providing both a v4l and v4l2 API (using the opensource pwc driver, version 10.0.7a). The following command line works and produces a proper MPEG4 file with MP2 audio (MP3 encoding is not available in the Debian version, I am unsure why, but thats fine with me): ffmpeg -s 640x480 -r 15 -vcodec mpeg4 -vtag DIVX /tmp/out.avi /tmp $ tcprobe -i out.avi [tcprobe] RIFF data, AVI video [avilib] V: 15.000 fps, codec=DIVX, frames=172, width=640, height=480 [avilib] A: 44100 Hz, format=0x50, bits=0, channels=1, bitrate=64 kbps, [avilib] 389 chunks, 81293 bytes, VBR [tcprobe] summary for out.avi, (*) = not default, 0 = not detected import frame size: -g 640x480 [720x576] (*) frame rate: -f 15.000 [25.000] frc=13 (*) audio track: -a 0 [0] -e 44100,0,1 [48000,16,2] -n 0x50 [0x2000] (*) bitrate=64 kbps length: 172 frames, frame_time=66 msec, duration=0:00:11.466 Now I want to stream from the video0 device, using the following ffserver.conf (removed all comments for brevity): Port 8090 BindAddress 0.0.0.0 MaxClients 1000 MaxBandwidth 1500 CustomLog - NoDaemon <Feed saibi.ffm> File /tmp/saibi.ffm FileMaxSize 200K ACL allow 127.0.0.1 </Feed> <Stream saibi.avi> Feed saibi.ffm Format avi AudioBitRate 24 AudioChannels 1 AudioSampleRate 22050 VideoBitRate 128 VideoFrameRate 15 VideoSize 320x240 VideoGopSize 60 </Stream> <Stream stat.html> Format status ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 </Stream> <Redirect index.html> URL http://ffmpeg.sourceforge.net/ </Redirect> I start ffserver, and the total log it dumps to stdout is this: /tmp$ ffserver ffserver started. 127.0.0.1 - - [Sun Sep 4 10:41:13 2005] "GET /saibi.ffm HTTP/1.0" 200 4165 127.0.0.1 - - [Sun Sep 4 10:41:13 2005] "GET /saibi.ffm HTTP/1.0" 200 4165 127.0.0.1 - - [Sun Sep 4 10:41:14 2005] "POST /saibi.ffm HTTP/1.0" 200 0 where the last three lines appear after I start ffmpeg: /tmp$ ffmpeg http://127.0.0.1:8090/saibi.ffm ffmpeg version CVS, build 3211265, Copyright (c) 2000-2004 Fabrice Bellard configuration: --build i486-linux-gnu --enable-gpl --enable-pp --enable-zlib --enable-vorbis --enable-libogg --enable-theora --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --prefix=/usr built on Aug 22 2005 20:00:15, gcc: 4.0.2 20050816 (prerelease) (Debian 4.0.1-5) Input #0, video4linux, from '': Duration: N/A, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 320x240, 15.00 fps Input #1, audio_device, from '': Duration: N/A, bitrate: N/A Stream #1.0: Audio: pcm_s16le, 22050 Hz, mono, 352 kb/s picture size invalid (0x0) Segmentation fault A gdb run of the ffmpeg produces: Program received signal SIGSEGV, Segmentation fault. 0x0815d6fa in img_resample_close () (gdb) bt #0 0x0815d6fa in img_resample_close () #1 0x0805d2ef in main () (gdb) x/4i $eip 0x815d6fa <img_resample_close+10>: mov 0x140(%ebx),%eax 0x815d700 <img_resample_close+16>: push %eax 0x815d701 <img_resample_close+17>: call 0x80ad350 <av_free> 0x815d706 <img_resample_close+22>: add $0x10,%esp (gdb) info reg ebx ebx 0x0 0 (gdb) info reg eax 0x1 1 ecx 0x0 0 edx 0xb7d79a7c -1210606980 ebx 0x0 0 esp 0xbff62054 0xbff62054 ebp 0xbff62068 0xbff62068 esi 0x0 0 edi 0x0 0 eip 0x815d6fa 0x815d6fa eflags 0x10282 66178 cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 (gdb) Being a NULL pointer deref. Does anyone know why this appears, how I can fix it or how I can provide more helpful information? Thanks, Sebastian PS: I used ffserver/ffmpeg with an older version of the pwc/pwcx driver about a year ago successfully to stream videos in three formats and I was very satisfied with the results. The webcam is the same, but about everything else changed :)
Hi I am not an expert but someone has said that ffserever is too old and isn't kept up to date anymore. This means is can't runn with newer codecs. Are you interested in rewriting ffserver to support newer options? David
Hi David, thank you for your reply. David Jonsson wrote:
I am not an expert but someone has said that ffserever is too old and isn't kept up to date anymore. This means is can't runn with newer codecs.
I would understand this, but I used the exact same ffserver.config file about a year ago and everything worked perfectly. So it must be something else (the codec is the same and worked) or the interfacing between ffmpeg and ffserver is not working anymore.
Are you interested in rewriting ffserver to support newer options?
Heh, quite frankly I planned to take a few hour look into the problem in case I do not receive a reply on this list ;-) But _rewriting_ ffserver is a little bit of a burden on both my schedule... :)
David
bye, Sebastian
participants (2)
-
David.Jonsson@tii.se -
nowozin@gmail.com