Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videotestsrc not working with gstreamer 1.0 #83

Closed
atoy40 opened this issue Mar 19, 2015 · 38 comments
Closed

videotestsrc not working with gstreamer 1.0 #83

atoy40 opened this issue Mar 19, 2015 · 38 comments

Comments

@atoy40
Copy link

@atoy40 atoy40 commented Mar 19, 2015

Hello,

I'm unable to launch a simple gstreamer pipeline with the gstreamer test source.
Here is the result (i've just modprobe the module and then launch the following command):

gst-launch-1.0  videotestsrc ! v4l2sink device=/dev/video1 
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason error (-5)
Execution ended after 0:00:00.066918471
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

with a GST_DEBUG=3, i found this error :

0:00:00.083227552 26991      0x23e4e30 ERROR                   v4l2 gstv4l2bufferpool.c:1132:gst_v4l2_buffer_pool_dqbuf:<v4l2sink0:pool:sink> No free buffer found in the pool at index 1.
0:00:00.083285313 26991      0x23e4e30 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:00.083295272 26991      0x23e4e30 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)

Im' using the version 0.8.0 packaged in ubuntu 14.10 with a 3.16.0 kernel

thank you very much.

Anthony.

@yukkeorg
Copy link

@yukkeorg yukkeorg commented Mar 20, 2015

i think this problem is related to #60.

@bsenicar
Copy link

@bsenicar bsenicar commented Jun 26, 2015

Any news on that issue?

I like to use gstreamer and using 0.10 branch is not really an option since it is long time depreciated and not recommended for future use.

BR Borut

@Adwind
Copy link

@Adwind Adwind commented Jul 20, 2015

To make gstreamer 1.0 we found a way around .

  1. You start a "client" with gstreamer 1.0 that has the videotestsrc (or other and their decoder) and sends over a udpsink.
    gst-launch-1.0 -v videotestsrc ! queue ! rtpvrawpay ! udpsink port=51111
  1. You start a "server" with gstreamer 0.10 that has the v4l2loopback (it works on that version of gstreamer)
    gst-launch-0.10 udpsrc port=51111 caps = (insert a caps that work from the caps given in the "client" part. Personally I used the second last caps proposed, but the only way to know is to test everyone until one work) ! rtpvrawdepay ! v4l2sink device=/dev/video0

That is how I manage to use v4l2loopback since the version of gstremer 1.0 can't run the v4l2loopback and gstreamer 0.10 can. Just remember that whatever you give to the v4l2sink of gstreamer 0.10 must be raw video.

@abickerton
Copy link

@abickerton abickerton commented Aug 2, 2015

This is also a problem in debian/sid version 0.9.1-2.

$gst-launch-0.10 videotestsrc ! v4l2sink device=/dev/video0

ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Failed to query attributes of input 0 in device /dev/video0

Additional debug info:
v4l2_calls.c(134): gst_v4l2_fill_lists (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Failed to get 0 in input enumeration for /dev/video0. (25 - Inappropriate ioctl for device)
Setting pipeline to NULL ...
@astronouth7303
Copy link

@astronouth7303 astronouth7303 commented Oct 30, 2015

I'm getting this on Debian Testing:

  • Linux 4.2.0-1-amd64
  • v4l2loopback-dkms 0.9.1-3
  • gstreamer1.0-plugins-good 1.6.0-1

My error is slightly different:

Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.034374233 16672      0x1a40d40 ERROR          v4l2allocator gstv4l2allocator.c:1299:gst_v4l2_allocator_dqbuf:<v4l2sink0:pool:sink:allocator> buffer 2 was not queued, this indicate a driver bug.
0:00:00.034428360 16672      0x1a40d40 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:00.034446519 16672      0x1a40d40 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
@atamariya
Copy link

@atamariya atamariya commented Nov 10, 2015

Try with my patch #100 .

[EDIT]: For error shown in abickerton's post.

@bsenicar
Copy link

@bsenicar bsenicar commented Nov 10, 2015

Still getting error as shown in astronouth7303 post.

BR Borut

@ghost
Copy link

@ghost ghost commented Nov 23, 2015

Same on latest Ubuntu :(

@dankasak
Copy link

@dankasak dankasak commented Nov 25, 2015

Me too :( Gentoo.

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Nov 25, 2015

patches welcome

@ndufresne
Copy link

@ndufresne ndufresne commented Oct 20, 2016

To all, v4l2loopback driver has important bugs in it's queue management. It's probably reporting some random buffer index. Since 1.0 we do validate this stuff since otherwise it can crash GStreamer. We also use larger queues to avoid doing buffer copied (while in 0.10 we always copy). For anything where the v4l2 queue is bigger then 2 frames, the driver output is wrong. A simple workaround is to use tee multiplexer, which forces a copy:

$ gst-launch-1.0 videotestsrc ! tee ! v4l2sink device=...

Long term, someone need to fix the driver.

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Oct 20, 2016

given my current time allocation, i'm happily accepting patches.

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Dec 2, 2016

hopefully fixed in 0.10.0

@ndufresne
Copy link

@ndufresne ndufresne commented Jan 16, 2017

I just rested, the fix is kind of partial. The suggested pipeline now works, but now we fail on the receiver side with the following sender:

$ gst-launch-1.0 videotestsrc ! tee ! v4l2sink
$ gst-launch-1.0 v4l2src ! videoconvert ! autovideosink
     gstv4l2allocator.c:1299:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> buffer 1 was not queued, this indicate a driver bug.
@baptx
Copy link

@baptx baptx commented Nov 9, 2017

I have to use the "tee" workaround on Xubuntu 16.04 LTS, you should add the example gst-launch-1.0 -v videotestsrc ! tee ! v4l2sink device=/dev/video1 in the wiki if other people get the "Internal data flow error".

@ndufresne
Copy link

@ndufresne ndufresne commented Nov 9, 2017

This will no longer work in 1.14, in replacement, you'll be able to workaround this driver bug with "identity drop-allocation=1".

@baptx
Copy link

@baptx baptx commented Nov 14, 2017

Good to know. Is there a way to fix the driver bug directly so we don't have to use a workaround?

@ndufresne
Copy link

@ndufresne ndufresne commented Nov 14, 2017

Sure, go ahead ;-P

@darenw
Copy link

@darenw darenw commented Mar 8, 2018

I'm trying to get a simple pipeline to work, sending video to v4l2sink. I can use videotestsrc just fine. It needed the 'tee' to work. But a specialized camera source isn't working at all. With or without tee. With the identity drop-allocation=1, I get:

WARNING: erroneous pipeline: no property "drop-allocation" in element "identity0"

???

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Mar 9, 2018

@darenw please make sure that your pipeline is actually valid before posting problems (if GSTreamer's identity element doesn't have a drop-allocation property, then you should read the documentation on identity first)

@thirdeye-peter
Copy link

@thirdeye-peter thirdeye-peter commented Jun 6, 2018

@darenw: drop-allocation is only available in gstreamer 1.14.x (and 1.13.x), it was only added recently

GStreamer/gstreamer@2cc5c53

@homespring
Copy link

@homespring homespring commented Aug 14, 2018

I don't know why this issue is closed... I'm using Xubuntu 18.04 with Gstreamer 1.14.1 and when I run pipeline:

gst-launch-1.0 videotestsrc ! identity drop-allocation=1 ! v4l2sink device=/dev/video100

I can't see any test video on /dev/video100. This makes v4l2loopback unusable on newer systems as I'm forced to use Xubuntu 16.04 with Gstreamer 1.8.3 so it can still work.

@raymanfx
Copy link

@raymanfx raymanfx commented Nov 4, 2019

Please reopen.
I'm on Fedora 31 with GST version: 1.16.1.
Running the following minimal example yields the "streaming stopped, reason not-negotiated (-4)" error. There's no way to work around it apparently, since 'tee' no longer works and GST 0.10 is broken in Fedora (packages deps cannot be resolved).

source:

gst-launch-1.0 videotestsrc ! identity drop-allocation=1 ! v4l2sink device=/dev/video9

sink:

gst-launch-1.0 v4l2src device=/dev/video9 ! autovideosink

EDIT: This issue not only affects videotestsrc, but all pipelines I tried so far.
E.g. the following wiki example gives me the very same error:

source:

gst-launch-1.0 -v \
    ximagesrc startx=1 starty=1 endx=320 endy=240 \
    ! videoconvert \
    ! "video/x-raw,format=YUY2" \
    ! v4l2sink device=/dev/video9

sink:

gst-launch-1.0 v4l2src device=/dev/video9 ! xvimagesink

EDIT2: Here's a full sample output with the error logs included:
https://hastebin.com/ovuxesamut.cpp

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Nov 4, 2019

@raymanfx it works here on Debian with gstreamer-1.16.1

  • which of the two commands throws the error?
  • which version of v4l2loopback do you use?
@raymanfx
Copy link

@raymanfx raymanfx commented Nov 4, 2019

Thanks for the quick answer.
It's always the sink pipeline that throws the error.
I'm on HEAD (94dcdf3).

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Nov 4, 2019

try loading the module with buffers=2 (or buffers=1):

sudo rmmod v4l2loopback
sudo modprobe v4l2loopback buffers=2

(and use identity drop-allocation=1 before v4l2sink in the source)

EDIT: i mistyped "consumer" instead of "source" in the line about identity)

@raymanfx
Copy link

@raymanfx raymanfx commented Nov 4, 2019

Neither combination is working, it's always the same error.
I tried buffers=1, buffers=2, and the drop-allocation attribute (basically all the samples listed in my previous comment).

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Nov 4, 2019

you need to both set buffer=2 and use drop-allocation (you probably did that, i just want to make sure)

@raymanfx
Copy link

@raymanfx raymanfx commented Nov 4, 2019

Yeah, I did that, but it didn't help.

@marcoippolito
Copy link

@marcoippolito marcoippolito commented Mar 16, 2020

I'm having, I think, the same problem with Ubuntu 18.04.4 Desktop:

(base) marco@pc01:~$ cheese

(cheese:18986): Gtk-WARNING **: 14:12:02.085: Theme parsing error: cheese.css:7:35: The style
property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be 
removed in a future version

(cheese:18986): cheese-WARNING **: 14:12:03.321: Failed to allocate a buffer: gstv4l2src.c(998):
gst_v4l2src_create (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source
/GstBin:bin18/GstV4l2Src:v4l2src1
@colin-adams
Copy link

@colin-adams colin-adams commented Mar 20, 2020

I'm having the same problem on Fedora - I have gstreamer 0.10 installed:

gstreamer-0.10.36-24.fc31.x86_64

I'm trying to use my DSLR as a webcam. Is there any known workaround currently?

@colin-adams
Copy link

@colin-adams colin-adams commented Mar 20, 2020

@raymanfx Did you ever have any success with Fedora?

@raymanfx
Copy link

@raymanfx raymanfx commented Mar 20, 2020

No, I could never make it work with recent versions of gstreamer.

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Mar 20, 2020

@colin-adams this ticket is explicitely about GStreamer-1.0, not about GStreamer-0.10. you can open a separate issue if you want to.

@drmichaeljgruber
Copy link

@drmichaeljgruber drmichaeljgruber commented Mar 30, 2020

Fedora 31, gstreamer 1.16.2, v4l2loopback v0.12.3-6-ge4f2c3c (current master)
gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video1 works whether I load the module without parameters or limitting the buffers.
[I have a different problem, though, which does not belong in this issue.]

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Mar 30, 2020

@drmichaeljgruber could you also specify which version of v4l2loopback you are using (just update your comment)

@zingfrid
Copy link

@zingfrid zingfrid commented Apr 1, 2020

Just leave it here, because I've spent half a day making it works!
sudo modprobe v4l2loopback buffers=2

gst-launch-1.0 rtspsrc location=rtsp://admin:admin@192.168.1.12 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! "video/x-raw,format=YUY2" ! tee ! v4l2sink device=/dev/video0

@umlaeute
Copy link
Owner

@umlaeute umlaeute commented Apr 1, 2020

that should be max_buffers=2 (and this is the default since e4f2c3c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.