GNOME Bugzilla – Bug 314160
[v4l2src] Implement compressed formats
Last modified: 2007-06-05 11:33:26 UTC
Version details: gnome-media 2.8.0-0.4 Distribution/Version: Debian Sarge 3.1 (KANOTIX 3.1 HD installation+Sarge Pacakes) 1. Connect your v4l2 webcam to the computer(mine is Genius Videocam NB, that uses v4l2 driver. The kernel supports the webcam, and I can use the webcam with some special application that I've found somewhere I don't remember now). 2. Run gstreamer-properties form terminal or choose appropriate icon from GNOME menus. 3. Choose Video tab. 4. Change "Default Source" to "Video for Linux 2 (v4l2) 5. Click "Test" 6. All done! You'll get a "Segmentation Fault". Note: If you don't connect the v4l2 webcam, you'll get a predicted error message: "Failed to construct test pipeline for 'Video for Linux 2 (v4l2)'".
When I use gdb to see the stack trace: . . . . [New Thread -1228674128 (LWP 23458)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1223236960 (LWP 23435)] 0xb6cb6687 in gst_v4l2_device_get_type () from /usr/lib/gstreamer-0.8/libgstvideo4linux2.so . . . Maybe I should install the debugging information. But I attach the strace here.
Created attachment 51107 [details] output of: "strace gstreamer-properties"
Can you please attach the backtrace? :) see http://live.gnome.org/GettingTraces And also attach the output of: $ GST_DEBUG=*:5 gstreamer-properties thanks!
This is the backtrace: (gdb) bt
+ Trace 63173
uhm that backtrace doesn't seem very usefull.. can you please try if one of these commands works? 1) gst-launch-0.8 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink 2) gst-launch-0.8 v4l2src ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! xvimagesink thanks! If they segfaults please attach the file created with: GST_DEBUG=v4l2src:5 gst-launch-0.8 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink &> file.out and/or GST_DEBUG=v4l2src:5 gst-launch-0.8 v4l2src ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! xvimagesink &> file.out
Both of those commands lead to segmentation fault. I attach the result files below. $ GST_DEBUG=v4l2src:5 gst-launch-0.8 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink &> file1.out Segmentation fault $ GST_DEBUG=v4l2src:5 gst-launch-0.8 v4l2src ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! xvimagesink &> file2.out $ GST_DEBUG=*:5 gstreamer-properties &>gst.txt
Created attachment 52767 [details] output of gst-launch-0.8 $ GST_DEBUG=v4l2src:5 gst-launch-0.8 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink &> file1.out Segmentation fault
Created attachment 52768 [details] output of gst-launch-0.8 for rgb $ GST_DEBUG=v4l2src:5 gst-launch-0.8 v4l2src ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! xvimagesink &> file2.out Segmentation fault
Created attachment 52769 [details] output of gstreamer-properties with debug level 5 $ GST_DEBUG=*:5 gstreamer-properties &>gst.txt
I get the same error with the same camera (I think). Backtrace generated with: $ gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink and $ gst-launch v4l2src ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! xvimagesink
+ Trace 65201
*** Bug 319359 has been marked as a duplicate of this bug. ***
The whole tuner/norm detection code there looks buggy -- I can't mentally prove that GST_TUNER (v4l2element) will return a usable value. Other than that there appear to be cases in which tuner_get_norm can return NULL without an error. So, in lieu of a full solution (e.g. understanding when tuner can be NULL), suggest just some checks to see if tuner_get_norm is NULL or not. But this code gives me the heebie geebies. Updating version to HEAD, as the same problem is there.
Hi Hossein, I think I have fixed this bug. Could you pleasde update your gstreamer and try the pipeline bellow (and also the others you have tried and let us know what happens) gst-launch v4l2src use-fixed-fps=false ! xvimagesink BR, Edgard Lima edgard.lima@indt.org.br
Edgard, Updated from CVS and tested your pipeline. Unfortunately, I still get a crash: Program received signal SIGSEGV, Segmentation fault.
+ Trace 67351
Thread NaN (LWP 21677)
Sorry, could you please try gstreamer 0.10. also, please compile the info.c (attached) program $gcc -Wall info.c and then run it $./aout and put the output here.
Created attachment 62458 [details] just to see the properties of a v4l2 device
Edgard, i tried to compile your info program to give you some detailes about my v4l2 device, but i was unable to compile it. Can you specify against wich kernel sources you where compiling? videodev2.h changed alot between the latest 2.6 kernels, so it would be easy to know wich one u used :) Also, in which gstreamer-0.10 package i have to find the v4l2src plugin?
Hi Pierre if you need some help in compiling info.c pls mail me the compiler error msg 2.6.15-19-686 v4l2plugins is under gst-plugins-bad/sys/v4l2 I do recommend to update gstreamer and gst-plugins-base first. BR
Created attachment 65445 [details] errors when compiling info.c Edgard, These are the errors I get when trying to compile your info.c program. I am using linux 2.6.16.
Created attachment 65446 [details] output of info program I tweaked a little the program (included <linux/types.h> instead of <sys/types.h>) and it compiled, but I noticed that the program runs in a infinite loop. I attach here the beginning of the output, if you need more, I can provide it.
Claudio, pls try put a videoscale like this: gst-launch v4l2src ! videoscale ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink
I updated, and get a very similar backtrace with that pipeline: (gdb) f 0
+ Trace 68522
v4l2src has been fixed/updated quite a bit and moved to gst-plugins-good in CVS. Any chance you could you try the version currently in -good CVS and check if the problem still exists (and get a new stack trace if yes)?
(In reply to comment #23) > v4l2src has been fixed/updated quite a bit and moved to gst-plugins-good in > CVS. > > Any chance you could you try the version currently in -good CVS and check if > the problem still exists (and get a new stack trace if yes)? > I did, and it doesnt work. At least it doesn't crash, but I get the following output: claudio@dijkstra:~/cvs/gnome-2.18/gst-plugins-good$ gst-launch v4l2src ! videoscale ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! xvimagesink Setting pipeline to PAUSED ... 0:00:00.278439000 20419 0x8051a40 ERROR basesrc gstbasesrc.c:1938:gst_base_src_activate_push:<v4l2src0> Failed to start in push mode ERROR: Pipeline doesn't want to pause. ERROR: from element /pipeline0/v4l2src0: Could not negotiate format Additional debug info: gstbasesrc.c(1837): gst_base_src_start (): /pipeline0/v4l2src0: Check your filtered caps, if any Setting pipeline to NULL ... FREEING pipeline ...
the camera not not support standard yuv or rgb formats. This is not yet supported by v4l2src. If seems to have s910 (no specifics found) and ba81 (which is described here: http://www.siliconimaging.com/RGB%20Bayer.htm).
Marking as enhancement, changing title.
gst-plugins-base: 2007-05-14 David Schleef <ds@schleef.org> * gst/videotestsrc/videotestsrc.c: * gst/videotestsrc/videotestsrc.h: Add support for video/x-raw-bayer. gst-plugins-good: 2007-05-14 David Schleef <ds@schleef.org> * sys/v4l2/gstv4l2src.c: Add support for Bayer images as video/x-raw-bayer. Fixes #314160. gst-plugins-bad: 2007-05-14 David Schleef <ds@schleef.org> * configure.ac: * gst/bayer/Makefile.am: * gst/bayer/gstbayer.c: * gst/bayer/gstbayer2rgb.c: Add a Bayer-to-RGB converter. You know you want one, uh-huh. Partial fix for #314160.