Webcamera I was able to stream USB webcam via

Hello, I was able to stream USB webcam via
root@verdin-imx8mp-14855083:/# gst-launch-1.0 v4l2src device=</dev/video3> ! fpsdisplaysink video-sink=waylandsink
ERROR: pipeline could not be constructed: no property “video-sink” in element “v4l2src”.
root@verdin-imx8mp-14855083:/# gst-launch-1.0 v4l2src device=/dev/video3 ! capsfilter caps=“video/x-h264,width=320,height=240” ! fpsdisplaysink video-sink=waylandsink
Setting pipeline to PAUSED …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/video3’ is not a capture device.
Additional debug info:
…/sys/v4l2/v4l2_calls.c(629): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4a00000
ERROR: pipeline doesn’t want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL …
Freeing pipeline …

Hi @saikumar,

Thanks for posting to Toradex community, unfortunately your question is not super clear. We are assuming you are not able to stream video with USB webacm connected to Verdin iMX8MP running TorizonCore.
As you can see from error /dev/video3 is not a capture device. Please check your webacm video index and then run gst pipeline. I am sharing one example tested with imx8 as below for reference

root@apalis-imx8-06738517:/# v4l2-ctl --list-devices
amphion vpu decoder (platform: amphion-vpu):
        /dev/video0
        /dev/video1
        /dev/media0

mxc-jpeg codec (platform:58400000.jpegdec):
        /dev/video2

mxc-jpeg codec (platform:58450000.jpegenc):
        /dev/video3

Lenovo FHD Webcam: Lenovo FHD W (usb-ci_hdrc.1-1.2.3):
        /dev/video4
        /dev/video5
        /dev/media1

root@apalis-imx8-06738517:/#  gst-launch-1.0 v4l2src device=/dev/video4 ! fpsdisplaysink video-sink=waylandsink

Hope this will help you with your query. If you still have any doubt feel free to write us back.

Best Regards
Ritesh Kumar

Thank you for your response.

I am using “How to use Cameras on Torizon | Toradex Developer Center” as reference

I am using the
som :-verdin imx8m plus
carrier board :-verdin Devlopment board v1.1
os :- Linux.

i am getting the error at “Creating a Gstreamer pipeline” that step.
As you mention by using v4l2-ctl --list-devices the following is the output:
C922 Pro Stream Webcam (usb-xhci-hcd.1.auto-1.2):
/dev/video2
/dev/video3

Failed to open /dev/video0: Device or resource busy

By using the command v4l2-ctl --device /dev/video3 -D
Driver Info:
Driver name : uvcvideo
Card type : C922 Pro Stream Webcam
Bus info : usb-xhci-hcd.1.auto-1.2
Driver version : 5.15.77
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04a00000
Metadata Capture
Streaming
Extended Pix Format
By using " gst-launch-1.0 v4l2src device=/dev/video3 ! capsfilter caps=“video/x-h264,width=320,height=240” ! fpsdisplaysink video-sink=waylandsink"
I am getting :
Setting pipeline to PAUSED …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/video3’ is not a capture device.
Additional debug info:
…/sys/v4l2/v4l2_calls.c(629): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4a00000
ERROR: pipeline doesn’t want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL …
Freeing pipeline …

I also tried what you suggested :“gst-launch-1.0 v4l2src device=/dev/video3 ! fpsdisplaysink video-sink=waylandsink

Setting pipeline to PAUSED …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/video3’ is not a capture device.
Additional debug info:
…/sys/v4l2/v4l2_calls.c(629): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4a00000
ERROR: pipeline doesn’t want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL …
Freeing pipeline …

Please help me to resolve the issue

Best Regards
sai kumar.

Hi @saikumar,

Try with /dev/video2. Further to check if the device is valid video capture device you can use v4l2-ctl tool to query video format device support.

e.g

/# v4l2-ctl --list-formats --device=/dev/video4
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'MJPG' (Motion-JPEG, compressed)
        [1]: 'YUYV' (YUYV 4:2:2)

Additionally please share how is your docker run commands look like to check if running container have right permission to access video device.

Best Regards
Ritesh Kumar

Thank you for your suggestion I have resolve the issue by using the /dev/video2 and the format is yuyv
The command i used to run the docker container is:
docker run -it --device=/dev/video0:/dev/video0 --device=/dev/video1:/dev/video1 --device=/dev/video2:/dev/video2 --device=/dev/video3:/dev/video3 -v /tmp:/tmp -v /sys:/sys -v /var/run/dbus:/var/run/dbus -v /dev:/dev --net host gstreamer:latest
The command I used to run the pipeline is:
gst-launch-1.0 v4l2src device=‘/dev/video2’ ! “video/x-raw, format=YUY2, framerate=5/1, width=640, height=480” ! fpsdisplaysink video-sink=waylandsink text-overlay=false sync=false

Best Regards
sai kumar.