After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 314160 - [v4l2src] Implement compressed formats
[v4l2src] Implement compressed formats
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 0.10.13
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 319359 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-22 11:14 UTC by Hossein Noorikhah
Modified: 2007-06-05 11:33 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
output of: "strace gstreamer-properties" (23.39 KB, application/x-bzip)
2005-08-22 11:18 UTC, Hossein Noorikhah
Details
output of gst-launch-0.8 (853 bytes, text/plain)
2005-09-28 10:28 UTC, Hossein Noorikhah
Details
output of gst-launch-0.8 for rgb (2.04 KB, text/plain)
2005-09-28 10:29 UTC, Hossein Noorikhah
Details
output of gstreamer-properties with debug level 5 (121.98 KB, application/x-gzip)
2005-09-28 10:31 UTC, Hossein Noorikhah
Details
just to see the properties of a v4l2 device (31.31 KB, text/plain)
2006-03-31 14:26 UTC, Edgard Lima
Details
errors when compiling info.c (31.42 KB, text/plain)
2006-05-14 16:00 UTC, Claudio Saavedra
Details
output of info program (4.76 KB, text/plain)
2006-05-14 16:21 UTC, Claudio Saavedra
Details

Description Hossein Noorikhah 2005-08-22 11:14:02 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)'".
Comment 1 Hossein Noorikhah 2005-08-22 11:16:47 UTC
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.
Comment 2 Hossein Noorikhah 2005-08-22 11:18:05 UTC
Created attachment 51107 [details]
output of: "strace gstreamer-properties"
Comment 3 Luca Ognibene 2005-09-20 18:50:58 UTC
Can you please attach the backtrace? :) see http://live.gnome.org/GettingTraces
And also attach the output of:

$ GST_DEBUG=*:5 gstreamer-properties

thanks!
Comment 4 Hossein Noorikhah 2005-09-24 11:29:39 UTC
This is the backtrace:

(gdb) bt
  • #0 gst_v4l2_open
    from /opt/gnome/lib/gstreamer-0.8/libgstvideo4linux2.so
  • #1 gst_v4l2element_get_type
    from /opt/gnome/lib/gstreamer-0.8/libgstvideo4linux2.so
  • #2 gst_v4l2src_get_type
    from /opt/gnome/lib/gstreamer-0.8/libgstvideo4linux2.so
  • #3 gst_element_get_time
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #4 gst_element_set_state
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #5 gst_bin_sync_children_state
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #6 gst_bin_get_by_name_recurse_up
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #7 gst_bin_set_state
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #8 gst_thread_set_priority
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #9 gst_element_get_time
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #10 gst_bin_set_state
    from /opt/gnome/lib/libgstreamer-0.8.so.1
  • #11 gst_element_set_state
  • #12 user_test_pipeline
  • #13 main

Comment 5 Luca Ognibene 2005-09-27 19:57:20 UTC
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
Comment 6 Hossein Noorikhah 2005-09-28 09:59:40 UTC
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
Comment 7 Hossein Noorikhah 2005-09-28 10:28:27 UTC
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
Comment 8 Hossein Noorikhah 2005-09-28 10:29:56 UTC
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
Comment 9 Hossein Noorikhah 2005-09-28 10:31:14 UTC
Created attachment 52769 [details]
output of gstreamer-properties with debug level 5

$ GST_DEBUG=*:5 gstreamer-properties &>gst.txt
Comment 10 Claudio Saavedra 2006-01-14 13:12:42 UTC
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


  • #0 gst_v4l2_set_defaults
    at v4l2_calls.c line 348
  • #1 gst_v4l2_open
    at v4l2_calls.c line 426
  • #2 gst_v4l2element_change_state
    at gstv4l2element.c line 581
  • #3 gst_v4l2src_change_state
    at gstv4l2src.c line 1077
  • #4 gst_element_set_state_func
    at gstelement.c line 2853
  • #5 gst_element_set_state
    at gstelement.c line 2796
  • #6 set_kid_state_func
    at gstbin.c line 841
  • #7 gst_bin_foreach
    at gstbin.c line 805
  • #8 gst_bin_change_state
    at gstbin.c line 903
  • #9 gst_pipeline_change_state
    at gstpipeline.c line 174
  • #10 gst_element_set_state_func
    at gstelement.c line 2853
  • #11 gst_bin_set_state
    at gstbin.c line 950
  • #12 gst_element_set_state
    at gstelement.c line 2796
  • #13 main
    at gst-launch.c line 538

Comment 11 Claudio Saavedra 2006-01-14 13:23:01 UTC
*** Bug 319359 has been marked as a duplicate of this bug. ***
Comment 12 Andy Wingo 2006-01-16 10:40:57 UTC
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.
Comment 13 Edgard Lima 2006-03-27 18:52:57 UTC
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
Comment 14 Claudio Saavedra 2006-03-30 19:01:14 UTC
Edgard,

Updated from CVS and tested your pipeline. Unfortunately, I still get a crash:

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 21677)

  • #0 gst_v4l2_set_defaults
    at v4l2_calls.c line 352
  • #1 gst_v4l2_open
    at v4l2_calls.c line 434
  • #2 gst_v4l2element_start
    at gstv4l2element.c line 537
  • #3 gst_v4l2src_start
    at gstv4l2src.c line 704
  • #4 gst_base_src_start
    at gstbasesrc.c line 1568
  • #5 gst_base_src_activate_push
    at gstbasesrc.c line 1698
  • #6 gst_pad_activate_push
    at gstpad.c line 800
  • #7 gst_pad_activate_default
    at gstpad.c line 552
  • #8 gst_pad_set_active
    at gstpad.c line 640
  • #9 activate_pads
    at gstelement.c line 2254
  • #10 gst_iterator_fold
    at gstiterator.c line 503
  • #11 iterator_fold_with_resync
    at gstelement.c line 2272
  • #12 gst_element_pads_activate
    at gstelement.c line 2309
  • #13 gst_element_change_state_func
    at gstelement.c line 2358
  • #14 gst_base_src_change_state
    at gstbasesrc.c line 1813
  • #15 gst_element_change_state
    at gstelement.c line 2177
  • #16 gst_element_set_state_func
    at gstelement.c line 2139
  • #17 gst_element_set_state
    at gstelement.c line 2049
  • #18 gst_bin_change_state_func
    at gstbin.c line 1753
  • #19 gst_pipeline_change_state
    at gstpipeline.c line 485
  • #20 gst_element_change_state
    at gstelement.c line 2177
  • #21 gst_element_change_state
    at gstelement.c line 2210
  • #22 gst_element_set_state_func
    at gstelement.c line 2139
  • #23 gst_element_set_state
    at gstelement.c line 2049
  • #24 main
    at gst-launch.c line 633

Comment 15 Edgard Lima 2006-03-31 14:23:54 UTC
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.
Comment 16 Edgard Lima 2006-03-31 14:26:31 UTC
Created attachment 62458 [details]
just to see the properties of a v4l2 device
Comment 17 Pierre Cassimans 2006-04-06 07:00:29 UTC
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?
Comment 18 Edgard Lima 2006-04-06 13:29:03 UTC
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
Comment 19 Claudio Saavedra 2006-05-14 16:00:37 UTC
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.
Comment 20 Claudio Saavedra 2006-05-14 16:21:36 UTC
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.
Comment 21 Edgard Lima 2006-05-29 14:31:44 UTC
Claudio, pls try put a videoscale like this:

gst-launch v4l2src ! videoscale ! video/x-raw-yuv,width=320,height=240 !
ffmpegcolorspace ! xvimagesink

Comment 22 Claudio Saavedra 2006-05-29 21:49:34 UTC
I updated, and get a very similar backtrace with that pipeline:

(gdb) f 0
  • #0 gst_v4l2_object_start
    at gstv4l2object.c line 476
  • #0 gst_v4l2_object_start
    at gstv4l2object.c line 476
  • #1 gst_v4l2src_start
    at gstv4l2src.c line 834
  • #2 gst_base_src_start
    at gstbasesrc.c line 1663
  • #3 gst_base_src_activate_push
    at gstbasesrc.c line 1793
  • #4 gst_pad_activate_push
    at gstpad.c line 804
  • #5 gst_pad_activate_default
    at gstpad.c line 556
  • #6 gst_pad_set_active
    at gstpad.c line 644
  • #7 activate_pads
    at gstelement.c line 2254
  • #8 gst_iterator_fold
    at gstiterator.c line 503
  • #9 iterator_fold_with_resync
    at gstelement.c line 2272
  • #10 gst_element_pads_activate
    at gstelement.c line 2309
  • #11 gst_element_change_state_func
    at gstelement.c line 2358
  • #12 gst_base_src_change_state
    at gstbasesrc.c line 1908
  • #13 gst_element_change_state
    at gstelement.c line 2177
  • #14 gst_element_set_state_func
    at gstelement.c line 2139
  • #15 gst_element_set_state
    at gstelement.c line 2049
  • #16 gst_bin_change_state_func
    at gstbin.c line 1754
  • #17 gst_pipeline_change_state
    at gstpipeline.c line 492
  • #18 gst_element_change_state
    at gstelement.c line 2177
  • #19 gst_element_change_state
    at gstelement.c line 2210
  • #20 gst_element_set_state_func
    at gstelement.c line 2139
  • #21 gst_element_set_state
    at gstelement.c line 2049
  • #22 main
    at gst-launch.c line 648

Comment 23 Tim-Philipp Müller 2006-10-17 17:27:22 UTC
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)?
Comment 24 Claudio Saavedra 2006-12-01 15:22:18 UTC
(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 ...
Comment 25 Wim Taymans 2007-02-01 09:02:33 UTC
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).
Comment 26 Wim Taymans 2007-03-02 09:50:13 UTC
Marking as enhancement, changing title.
Comment 27 David Schleef 2007-05-15 03:00:24 UTC
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.