Open ROBERT-MCDOWELL opened 5 years ago
machine info: Fedora 27 64bits kernel 4.19.1-rt3 v4l2loopback version: 0.12.0
that doesn't seem to be a valid gstreamer-1.0 caps-string, the format yuv
does not exist.
try something like UYVY
instead.
ok thanks now I get
$ v4l2loopback-ctl set-caps "video/x-raw,format=UYVY, width=640, height=480" /dev/video1
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.
Additional debug info:
v4l2_calls.c(642): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x85208000
Setting pipeline to NULL ...
Freeing pipeline ...
output to /dev/video1 failed
Is it possible for v4l2loopback device to accept mjpeg as input? I tried to set caps like
v4l2loopback-ctl set-caps "image/jpeg, width=1280, height=720, fps=30/1" /dev/video1
where /dev/video1 is my v4l2loopback device. It seems like it is using gstreamer videotestsrc as the pipeline video src for setting the caps, and
gst-inspect-1.0 videotestsrc
shows videotestsrc only accepts paddings as video/x-raw.
My question here would be, can we set mjpeg as the format for v4l2loopback device?
sure. you can. the current behaviour simply a limitation of the v4l2loopback-ctl
script (or rather, as you noted, the underlying videotestsrc
element).
you can manually change the output-format by running a pipeline like:
gst-launch-1.0 videotestsrc num-buffers=1 ! "video/x-raw, width=1280, height=720, fps=30/1" ! avenc_mjpeg ! v4l2sink device=/dev/video1
I'm getting the same error as @ROBERT-MCDOWELL above:
$ sudo v4l2loopback-ctl set-caps "video/x-raw,format=UYVY, width=1920, height=1200" /dev/video0
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video0' is not a output device.
Additional debug info:
../gst-plugins-good/sys/v4l2/v4l2_calls.c(636): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x5208000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
output to /dev/video0 failed
Edit:
Looks like this was solved by removing the exclusive_caps=1
option when starting the v4l2loopback
kernel module.
I'm getting the same error as @ROBERT-MCDOWELL above:
$ sudo v4l2loopback-ctl set-caps "video/x-raw,format=UYVY, width=1920, height=1200" /dev/video0 Setting pipeline to PAUSED ... ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video0' is not a output device. Additional debug info: ../gst-plugins-good/sys/v4l2/v4l2_calls.c(636): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Capabilities: 0x5208000 ERROR: pipeline doesn't want to preroll. Failed to set pipeline to PAUSED. Setting pipeline to NULL ... Freeing pipeline ... output to /dev/video0 failed
Edit: Looks like this was solved by removing the
exclusive_caps=1
option when starting thev4l2loopback
kernel module.
Is there a way to prevent this behavior without removing that option? I need that option for Discord and Chrome.
I just created a video device with
tried to set it like this
but I get
any idea? thanks