GNOME Bugzilla – Bug 666146
gstreamer v4l2src fails with device=
Last modified: 2012-01-07 12:21:32 UTC
I have only one video device, it is /dev/video0. This works: $ gst-launch 'v4l2src ! xvimagesink' Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock (video plays) This does not work: $ gst-launch 'v4l2src device=/dev/video0 ! xvimagesink' Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error. Additional debug info: gstbasesrc.c(2582): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming task paused, reason not-linked (-1) Execution ended after 2532703705 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... This means that I cannot read from video1, or use v4l2loopback or anything, since gstreamer apparently cannot deal with the device= setting. For the record, here is part of gst-inspect v4l2src: Element Properties: name : The name of the object flags: readable, writable String. Default: null Current: "v4l2src0" blocksize : Size in bytes to read per buffer (-1 = default) flags: readable, writable Unsigned Long. Range: 0 - 18446744073709551615 Default: 4096 Current: 4096 num-buffers : Number of buffers to output before sending EOS (-1 = unlimited) flags: readable, writable Integer. Range: -1 - 2147483647 Default: -1 Current: -1 typefind : Run typefind before negotiating flags: readable, writable Boolean. Default: false Current: false do-timestamp : Apply current stream time to buffers flags: readable, writable Boolean. Default: false Current: false device : Device location flags: readable, writable String. Default: "/dev/video0" Current: "/dev/video0" device-name : Name of the device flags: readable String. Default: null Current: "UVC Camera (17ef:4807)" device-fd : File descriptor of the device flags: readable Integer. Range: -1 - 2147483647 Default: -1 Current: -1 flags : Device type flags flags: readable Flags "GstV4l2DeviceTypeFlags" Default: 0x00000000, "(none)" Current: 0x00000000, "(none)" (0x00000001): capture - Device supports video capture (0x00000002): output - Device supports video playback (0x00000004): overlay - Device supports video overlay (0x00000010): vbi-capture - Device supports the VBI capture (0x00000020): vbi-output - Device supports the VBI output (0x00010000): tuner - Device has a tuner or modulator (0x00020000): audio - Device has audio inputs or outputs ProblemType: Bug DistroRelease: Ubuntu 11.10 Package: gstreamer-tools 0.10.35-1 ProcVersionSignature: Ubuntu 3.0.0-13.22-generic 3.0.6 Uname: Linux 3.0.0-13-generic x86_64 NonfreeKernelModules: fglrx ApportVersion: 1.23-0ubuntu4 Architecture: amd64 Date: Sat Dec 3 14:33:54 2011 EcryptfsInUse: Yes InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007) ProcEnviron: PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gstreamer0.10 UpgradeStatus: Upgraded to oneiric on 2011-11-30 (3 days ago) Please see additional information at https://bugs.launchpad.net/ubuntu/+source/gstreamer0.10/+bug/899748
Could you provide the following please: gzipped/bzip2-ed dbg.log of: a) GST_DEBUG=*:5 gst-launch v4l2src num-buffers=10 ! xvimagesink 2>dbg.log b) GST_DEBUG=*:5 gst-launch v4l2src device=/dev/video0 ! xvimagesink 2>dbg.log c) output of: v4l2-ctl -n -N d) output of: ls -l /dev/video* Does this work: gst-launch -v v4l2src device=/dev/video0 num-buffers=1 ! ffmpegcolorspace ! xvimagesink
Created attachment 204297 [details] GST_DEBUG='*:5' gst-launch 'v4l2src num-buffers=10 ! xvimagesink' Command also fails.
shevek@shadow:~$ v4l2-ctl -n -N ioctl: VIDIOC_ENUMINPUT Input : 0 Name : Camera 1 Type : 0x00000002 Audioset : 0x00000000 Tuner : 0x00000000 Standard : 0x0000000000000000 () Status : 0x00000000 (ok) Capabilities: 0x00000000 (not defined) ioctl: VIDIOC_ENUMOUTPUT shevek@shadow:~$ ls -l /dev/video* crw-rw----+ 1 root video 81, 0 2011-12-16 15:39 /dev/video0 shevek@shadow:~$ id uid=1000(shevek) gid=1000(shevek) groups=1000(shevek),4(adm),20(dialout),24(cdrom),46(plugdev),111(lpadmin),119(admin),122(sambashare) Putting myself in the video group makes no difference. This works: v4l2src ! ffmpegcolorspace ! xvimagesink This does not work: v4l2src device=/dev/video0 num-buffers=1 ! ffmpegcolorspace ! xvimagesink However, in all the cases where I say "does not work", the green camera LED flashes before the pipeline breaks.
From this end, the common feature appears to be option parsing on v4l2src, but then, I am _not_ going to read that debug log (sorry!). However, hopefully this resolves the NEEDINFO for now?
Sure, thanks for the logs.
> Created an attachment (id=204297) [details] > GST_DEBUG='*:5' gst-launch 'v4l2src num-buffers=10 ! xvimagesink' > Command also fails. Please could you try this again, but this time without the apostrophes, exactly as I wrote it in (a) and (b)? Thanks!
Ha, I'm used to bash version 1 where a spurious ! would cause a failed history expansion, so I automatically added them. I always thought ! was an odd choice. But bash version 4 (as I now see) isn't as anal about spurious bang-marks. Without the quotation marks, the commands both work, and my original experiment to do with v4l2loopback and dv1394src now works. I still claim there's a bug here[0], but is it in the command parsing/expansion rather than the v4l2 code? [0] I'm the user, and therefore automatically right?
I think as long as you put a space after the ! you're good. Don't remember if that's also the case for ancient bash versions though, haven't heard of problems with that anywhere though. (In reply to comment #7) > Without the quotation marks, the commands both work, and my original experiment > to do with v4l2loopback and dv1394src now works. Ok, great. I'll close the bug then, feel free to re-open if you run into the problem again. > I still claim there's a bug here[0], but is it in the command parsing/expansion > rather than the v4l2 code? [0] I'm the user, and therefore automatically right? You mean you think gst-launch should work even if you pass the entire pipeline as one single argument? Not an unreasonable request, but I don't think it's worth it and will just make things more confusing because of escaping. gst-launch is just a debugging tool, best to use gst_parse_launch() from C or your favourite scripting language. So probably a WONTFIX.