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

Revisions 0.5.0, 0.6.1, and 0.6.2 don't work under Ubuntu 12.04 LTS #34

Closed
sinclairrf opened this issue Dec 13, 2012 · 15 comments
Closed

Comments

@sinclairrf
Copy link

v4l2loopback 0.4.1 works under Ubuntu 12.04 LTS using the following commands:
sudo modprobe v4l2loopback devices=8 max_buffers=8
gst-launch-0.10 v4l2src device=/dev/video7 ! deinterlace method=linear ! v4l2sink device=/dev/video15

Revisions 0.5.0, 0.6.1, and 0.6.2 produce error messages when the following commands are performed:
sudo modprobe v4l2loopback devices=8
gst-launch-0.10 v4l2src device=/dev/video7 ! deinterlace method=linear ! v4l2sink device=/dev/video15

The output from gst-launch is:
Setting pipeline to PAUSED ...
libv4l2: error getting pixformat: Invalid argument
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...

@umlaeute
Copy link
Owner

try adding an ffmpegcolorspace somewhere between the v4l2src and the sink (this object often does wonders).

if it doesn't help, pleas run gstreamer with "-v" and/or with GST_DEBUG flags set.

@sinclairrf
Copy link
Author

I installed 0.6.2 and got the following:

sudo modprobe v4l2loopback devices=8
gst-launch-0.10 -v v4l2src device=/dev/video7 ! deinterlace method=linear ! ffmpegcolorspace ! v4l2sink device=/dev/video15
Setting pipeline to PAUSED ...
libv4l2: error getting pixformat: Invalid argument
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...

@umlaeute
Copy link
Owner

try raising GST_DEBUG flags to 3..5 to see something more informative.

does it work if you use videotestsrc as the producer (instead of v4l2src)?
does it work if you use xvimagesink as the consumer (instead of v4l2sink)?

@sinclairrf
Copy link
Author

Attached, please find the GST_DEBUG output,

Thank you for your help,
Rodney

On 12/13/2012 08:25 AM, umlaeute wrote:

if it doesn't help, please run gstreamer with "-v" and/or with
GST_DEBUG flags set.


Reply to this email directly or view it on GitHub
#34 (comment).

@sinclairrf
Copy link
Author

videotestsrc and xvimagesink both work with 0.6.2.

The dump using GST_DEBUG='*:5' was e-mailed (see preceding comment). It's 3.5 MB uncompressed and I don't know what to look for.

@sinclairrf
Copy link
Author

Did you get the GST_DEBUG printout?

@sinclairrf
Copy link
Author

I have an ugly work-around using 0.4.1 for the time being -- create two v4l2loopback devices for each of my video sources:

gst-launch-0.10 v4l2src device=/dev/video7 ! tee name=vid7
vid7. ! queue ! theoraenc ! filesink location=/data/user/vid7.mpg
vid7. ! queue ! deinterlace method=linear ! v4l2sink device=/dev/video8
vid7. ! queue ! deinterlace method=linear ! v4l2sink device=/dev/video9

I can then display /dev/video8 and /dev/video9 with no problems.

This does mean I'll need to make 24 v4l2loopback devices to replicate the 12 input video channels in my hardware.

@umlaeute
Copy link
Owner

it seems like the email with the GST_DEBUG printout got lost (or rather: it had no attachments).
just in case: don't forget to compress it it :-)

@umlaeute
Copy link
Owner

from your tests with xvimagesink and videotestsrc i guess, that v4l2loopback-0.6.2 works ok on your machine, and you have some problems with caps negotiation.

it would be good to know what the caps are in the working setup (with v4l2loopback-0.4.1): please make sure you load the old modules then run your simple pipeline with "-v", this should give you the used caps.
then try to manually force these caps when using the new version of v4l2loopback

@sinclairrf
Copy link
Author

command:
gst-launch-0.10 -v v4l2src device=/dev/video14 ! xvimagesink display=:0.0

produces:
caps = video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)30000/1001, width=(int)704, height=(int)480, interlaced=(boolean)true, pixel-aspect-ratio=(fraction)1/1

command using v4l2loopback 0.4.1:
gst-launch-0.10 -v v4l2src device=/dev/video14 ! deinterlace ! v4l2sink device=/dev/video16

produces:
v4l2sink0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)30000/1001, width=(int)704, height=(int)480, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1

command using v4l2loopback 0.6.2:
gst-launch-0.10 v4l2src device=/dev/video14 ! deinterlace ! 'video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)30000/1001, width=(int)704, height=(int)480, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1' ! v4l2sink device=/dev/video16

produces:
Setting pipeline to PAUSED ...
libv4l2: error getting pixformat: Invalid argument
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...

But then, it didn't work with 0.4.1 either.

The following does work with both versions:
gst-launch-0.10 -v v4l2src device=/dev/video14 ! deinterlace ! 'video/x-raw-yuv,format=(fourcc)YUY2' ! v4l2sink device=/dev/video16

I haven't been able to find a way to upload the GST_DEBUG dump to github. Do you know of a place where I can upload it?

@sinclairrf
Copy link
Author

When I rebooted the machine it didn't work.

The command:
gst-launch-0.10 -v v4l2src device=/dev/video14 ! deinterlace ! 'video/x-raw-yuv,format=(fourcc)YUY2' ! v4l2sink device=/dev/video16

Produced the following error message:
Setting pipeline to PAUSED ...
libv4l2: error getting pixformat: Invalid argument
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...

@entd
Copy link

entd commented Feb 8, 2013

It seems I have same issue. I tried with with both gstreamer-0.10 and gstreamer-1.0 combined with v4l2loopback 0.6.2 and it quits with the same message. Just wondering, does:

v4l2-ctl -d /dev/video3 -V

should output any formats supported by loopback device? (Where "/dev/video3" is loopback device). When I do it throws:
VIDIOC_G_FMT: failed: Invalid argument
What could I do to help track issue.

@entd
Copy link

entd commented Feb 8, 2013

Sorry for bothering, seems latest git release (6.3) is working well.
Edit: well at least part where I output to xvimagesink.
My pipeline:

gst-launch-0.10 -v \
    v4l2src  device=/dev/video1  \
    ! image/jpeg,width=640, height=480 \
    ! jpegdec \
    ! ffmpegcolorspace \
    ! queue  \
    ! video/x-raw-yuv,width=640, height=480 \
    ! decodebin2 \
    ! v4l2sink device=/dev/video6

doesn't work at all. What could be wrong with caps or timing?
Output: http://pastebin.com/SB7LxmKg
Can it be related to this issue?

@yukkeorg
Copy link

Hi. You try to remove 'decodebin2' in your pipline and add 'format=(fourcc)YUY2' on caps.

full pipeline:

gst-launch-0.10 -v \
    v4l2src  device=/dev/video1 \
    ! image/jpeg,width=640, height=480 \
    ! jpegdec \
    ! ffmpegcolorspace \
    ! queue \
    ! video/x-raw-yuv,width=640,height=480,format=(fourcc)YUY2 \
    ! v4l2sink device=/dev/video6

I hope this helps.

@entd
Copy link

entd commented Feb 18, 2013

Thanks for answer, I found problems why my pipeline doesn't work. It needed to be converted to YUV colorspace (JPEGDEC spits I420) and second, it needs videorate, because my webcam UVC device couldn't properly handle timestamps (videorate drops many frames as "fixes it", so real solution would be retimestamp all frames). Strangely enough input in xvideosink works nicely even with bad timestamps (probably frames are controled by framerate not timestamps, as do in timestamp ignoring containers), while chunks of very closely timestamped frames just kills loopback device sink. Now I am trying to restamp frames properly with stamp plug-in.

Anyway it probably has nothing to do with v4l2loopback device.

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

No branches or pull requests

4 participants