GNOME Bugzilla – Bug 778438
Failed to get video stream from v4l2loopback device by using gstreamer 1.2.4 and gstreamer 1.8.2
Last modified: 2017-02-16 05:42:02 UTC
I tried to get video stream from v4l2loopback device by using Ubuntu 14.04 LTS, Ubuntu 15.10, and Ubuntu 16.04 LTS but only Ubuntu 15.10 worked. The procedure to reproduce this issue is as follow: A USB webcam (Logitech c930e) is connected to laptop and refer as /dev/video0 ubuntu@ubuntu:~/Downloads/v4l2loopback$ ls /dev/video* /dev/video0 A v4l2loopback device is created with the following modprobe command: ubuntu@ubuntu:~/Downloads/v4l2loopback$ sudo modprobe v4l2loopback device=1 The loopback device is refer as /dev/video1 ubuntu@ubuntu:~/Downloads/v4l2loopback$ ls /dev/video* /dev/video0 /dev/video1 For ubuntu 14.04.05 LTS ubuntu@ubuntu:~/Downloads/v4l2loopback$ uname -a Linux ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux ubuntu@ubuntu:~/Downloads/v4l2loopback$ gst-launch-1.0 --version gst-launch-1.0 version 1.2.4 GStreamer 1.2.4 https://launchpad.net/distros/ubuntu/+source/gstreamer1.0 At 1st terminal ubuntu@ubuntu:~/Downloads/v4l2loopback$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=I420, framerate=30/1, width=640, height=480 ! v4l2sink device=/dev/video1 Setting pipeline to PAUSED ... libv4l2: error getting pixformat: Invalid argument Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock At 2nd terminal ubuntu@ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, format=I420, framerate=30/1, width=640, height=480 ! videoconvert ! xvimagesink sync=false 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(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming task paused, reason error (-5) Execution ended after 0:00:00.028176082 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... For Ubuntu 15.10 ubuntu@ubuntu:~$ uname -a Linux ubuntu 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux ubuntu@ubuntu:~$ gst-launch-1.0 --version gst-launch-1.0 version 1.6.0 GStreamer 1.6.3 https://launchpad.net/distros/ubuntu/+source/gstreamer1.0 At 1st terminal ubuntu@ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=I420, framerate=30/1, width=640, height=480 ! v4l2sink device=/dev/video1 Setting pipeline to PAUSED ... libv4l2: error getting pixformat: Invalid argument Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock At 2nd terminal ubuntu@ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, format=I420, framerate=30/1, width=640, height=480 ! videoconvert ! xvimagesink sync=false Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock ^Chandling interrupt. Interrupt: Stopping pipeline ... Execution ended after 0:00:03.668339317 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... For Ubuntu 16.04 LTS ubuntu@ubuntu:~$ uname -a Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux ubuntu@ubuntu:~$ gst-launch-1.0 --version gst-launch-1.0 version 1.8.2 GStreamer 1.8.2 https://launchpad.net/distros/ubuntu/+source/gstreamer1.0 At 1st terminal ubuntu@ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=I420, framerate=30/1, width=640, height=480 ! v4l2sink device=/dev/video1 Setting pipeline to PAUSED ... libv4l2: error getting pixformat: Invalid argument Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock At 2nd terminal ubuntu@ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, format=I420, framerate=30/1, width=640, height=480 ! videoconvert ! xvimagesink sync=false 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: Failed to allocate a buffer Additional debug info: gstv4l2src.c(884): gst_v4l2src_create (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0 Execution ended after 0:00:00.032129266 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... P.S: guvcview has no problem to open the v4l2loopback device /dev/video1 in Ubuntu 14.04 LTS, Ubuntu 15.10, and Ubuntu 16.04 LTS The v4l2loopback module is downloaded from https://github.com/umlaeute/v4l2loopback
Enabling GST_DEBUG=3 would have printed the error, which would have clearly indicated that the driver is buggy. I'm sorry, but this bug triggers as soon as you need more then 2 buffers from the driver. GStreamer cannot support this driver, fixing the driver is the right way.
Problem solved after I downgrade the v4l2loopback driver from 0.10 to 0.9.