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 635351 - gst-camera crashes trying to record video
gst-camera crashes trying to record video
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: dont know
0.10.29
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-20 15:50 UTC by Victor Bandur
Modified: 2011-03-18 11:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Victor Bandur 2010-11-20 15:50:57 UTC
Overview:
--------
Trying to record video using gst-camera crashes the application with the following output:

(gst-camera:18291): GStreamer-CRITICAL **: 
Trying to dispose element autoaudiosrc0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

Camerabin won't start up!
Error: Internal GStreamer error: negotiation problem.  Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Debug Info: camerabingeneral.c(60): gst_camerabin_add_element (): /GstCameraBin:camerabin3/GstCameraBinVideo:camerabinvideo3:
linking vorbisenc0 failed

Steps to Reproduce:
------------------
Run gst-camera and try to record video using ``Video record''.

Actual Results:
--------------
Application crashes with the output shown above.

Build Date and Platform:
-----------------------
Version 0.10.29, Gentoo Linux for PPC, Kernel version 2.6.34.

Additional Information:
----------------------
Using camera Logitech QuickCam for Notebooks with kernel driver ``gspca_zc3xx''.  Camera works fine with other applications that are not GStreamer-based.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-27 18:40:35 UTC
What is v4l-info reporting for the camera. I believe the camera is outputting (m)jpeg only which we don't support in camerabin.
Comment 2 Victor Bandur 2010-11-27 18:49:41 UTC
Hi Stefan,
I think you are right.  This is the output of v4l-info,

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
        driver                  : "zc3xx"
        card                    : "Camera         "
        bus_info                : "usb-0001:10:1b.0-1"
        version                 : 2.9.0
        capabilities            : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards

inputs
    VIDIOC_ENUMINPUT(0)
        index                   : 0
        name                    : "zc3xx"
        type                    : CAMERA
        audioset                : 0
        tuner                   : 0
        std                     : 0x0 []
        status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
        index                   : 0
        type                    : VIDEO_CAPTURE
        flags                   : 1
        description             : "JPEG"
        pixelformat             : 0x4745504a [GEPJ]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
        type                    : VIDEO_CAPTURE
        fmt.pix.width           : 640
        fmt.pix.height          : 480
        fmt.pix.pixelformat     : 0x4745504a [GEPJ]
        fmt.pix.field           : NONE
        fmt.pix.bytesperline    : 640
        fmt.pix.sizeimage       : 115790
        fmt.pix.colorspace      : JPEG
        fmt.pix.priv            : 0

controls

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
        name                    : "Camera         "
        type                    : 0x1 [CAPTURE]
        channels                : 1
        audios                  : 0
        maxwidth                : 640
        maxheight               : 480
        minwidth                : 48
        minheight               : 32


channels
    VIDIOCGCHAN(0)
        channel                 : 0
        name                    : "zc3xx"
        tuners                  : 0
        flags                   : 0x0 []
        type                    : CAMERA
        norm                    : 0

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
    VIDIOCGAUDIO
        audio                   : 0
        volume                  : 0
        bass                    : 0
        treble                  : 0

picture
    VIDIOCGPICT
        brightness              : 0
        hue                     : 0
        colour                  : 0
        contrast                : 32896
        whiteness               : 39321
        depth                   : 8
        palette                 : unknown

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
    VIDIOCGWIN
        x                       : 0
        y                       : 0
        width                   : 640
        height                  : 480
        chromakey               : 0
        flags                   : 0

Victor
Comment 3 Sebastian Dröge (slomo) 2010-12-12 15:46:02 UTC
So this camera only supports mjpeg... Stefan, is this now supported in camerabin?
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2010-12-16 18:42:27 UTC
As of comment #1 no, its not supported and neither it is in camerabin2. It's not really the target of the project. It could be supported by having a decodebin2 in the source, but that's a bit besides the point.

jpeg only cameras where basically done due to usb-1 bandwidth limittations and are kind of dying out (I have the same one btw.). Also there is a workaround:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so gst-launch camerabin
Comment 5 Victor Bandur 2010-12-16 19:07:03 UTC
Hi Stefan,

This workaround brings up the video window, but I'm not sure how to record a video.  This was the reason I submitted the bug in the first place.

Victor
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2010-12-16 21:08:04 UTC
Victor, is the camerabin API doc unclear about this? then we need to improve it. Please check it. Otherwise I believe we can close this ticket.
Comment 7 Victor Bandur 2010-12-16 23:12:27 UTC
Stefan,

The only way I can find of recording a clip with the workaround is programmatically.  With gst-camera one could, if the application worked, record a video by clicking a button.  Am I missing something?

Victor
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2010-12-17 12:49:12 UTC
Victor, the LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so workaround works will all kind of apps. I do use this for skype. You can run
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so gst-camera
as well. Be aware that gst-camera is merly a demo for camerabin. As you noticed the other way is to write a program. Have you been considering to use cheese?
Comment 9 Victor Bandur 2010-12-17 13:17:18 UTC
Hi Stefan,

1.  The LD_PRELOAD thing works for a lot of applications that don't understand the pixel format natively (I used to do it for Skype too on my Intel computer), but gst-camera still crashes.

2.  I filed the bug because gst-camera's message asks that the a bug be filed:  ``Error: Internal GStreamer error: negotiation problem.  Please file a bug at ...''

I was trying gst-camera in order to see what performance I could get from it, because my computer is too slow for Cheese to record video at 640x480.  I was hopeful because Totem, for instance, plays videos with much lower CPU utilization than, say, MPlayer, when they are both set up similarly in terms of video output.

Should I, as the initiator, close this bug then?
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2010-12-17 13:21:56 UTC
Video encoding uses a magnitude more CPU then playback. Recording with gst-camera would use the same codecs as cheese would use as both are using gstreamer. The situation will become better in the future as we just got encodebin in gstreamer and that will allow you to select a encoding profile. With that you could choose to record in a less demanding format. The same can be achieved by writing a program, but that is out-of-the scope of commenting on the ticket.

To clarify, do you get the "Error: Internal GStreamer error: negotiation problem." from gst-camera also when using LD_PRELOAD? If not, please close the bug.
Comment 11 Victor Bandur 2010-12-17 13:29:38 UTC
Good to know about the intended direction.

Yes, I get the same message when using LD_PRELOAD, but with a small difference on the line ``/GstCameraBin:camerabin0/GstCameraBinVideo:camerabinvideo0:'':


mot@saint-saens ~ $ LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so gst-camera

(gst-camera:6535): GStreamer-CRITICAL **: 
Trying to dispose element autoaudiosrc0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

Camerabin won't start up!
Error: Internal GStreamer error: negotiation problem.  Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Debug Info: camerabingeneral.c(60): gst_camerabin_add_element (): /GstCameraBin:camerabin0/GstCameraBinVideo:camerabinvideo0:
linking vorbisenc0 failed
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2010-12-20 08:42:05 UTC
This looks like a different issue - "linking vorbisenc0 failed". Can run it as:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so GST_DEBUG="*:5" GST_DEBUG_NO_COLOR=1 gst-camera 2>debug.log
and attach the log here (gzip it if too large).

A few more questions:
What linux distro are you using?
What gstreamer versions are you using?
If you start gstreamer-properties, what is the audio-source there?

I wonder if we miss a audioconvert in the test app. Can you edit the source of tests/examples/camerabin/gst-camera.c, line 548 and change:
  g_object_set (gst_camera_bin, "flags", 0xdf, NULL);
to
  g_object_set (gst_camera_bin, "flags", 0xff, NULL);
and retry.
Comment 13 Tobias Mueller 2011-03-18 11:08:59 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!