Dear Toradex Community,
I hope this message finds you well. I’m reaching out to seek your guidance on accessing the USB camera (HP w100 Webcam) feed from Verdin iMX8M Plus Quad 4GB WB IT V1.1A and Verdin Development Board V1.1C.
I have been trying to access the USB camera feed from these boards, but I have not been successful. I have searched through the documentation and forums, but we have not found a solution that works for me.
I would appreciate any guidance you can offer me on how to access the USB camera feed on these boards. Specifically, I would like to know:
- How do we enable the USB camera interface on these boards?
- How do we access the camera feed from within our application code?
I would be grateful for any information, sample code, or tutorials that you can provide me with. Thank you in advance for your help.
Greetings @Adwaith,
General USB cameras should just work out of the box with our software. In terms of getting camera feed in an application, it depends a bit exactly what you’re trying to do, but we do have a general article on cameras in TorizonCore: How to use Cameras on Torizon | Toradex Developer Center
You are using TorizonCore correct? I assume so since you tagged your question with “torizon”.
Best Regards,
Jeremias
I’m facing the following problem even though my USB camera is a capture device.
root@b5a3ff2327c6:/# v4l2-ctl --list-devices
W100: W100 (usb-xhci-hcd.1.auto-1.2):
/dev/video3
Failed to open /dev/video0: Operation not permitted
root@b5a3ff2327c6:/# gst-launch-1.0 v4l2src device=‘/dev/video3’ ! “video/x-raw, format=YUY2, framerate=5/1, width=640, height=480” ! fpsdisplaysink video-sink=waylandsink text-overlay=false sync=false
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 …
root@b5a3ff2327c6:/#
According to this line: ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/video3’ is not a capture device.
The device /dev/video3
is not a capture device capable of producing a video feed. Are you sure you passed the correct /dev/video*
entry?
I tried the example on my USB camera and it seems to work fine.
Best Regards,
Jeremias
Yes, I have passed the correct /dev/video*
entry. /dev/video3 shows me the driver info of my USB Webcam.
Well the issue still is that this isn’t being read as a capture device. With my USB camera 2 /dev/video*
entries get created but only 1 is suitable as a capture device for gstreamer purposes. Could you try other entries just to make sure.
Best Regards,
Jeremias
gst-launch-1.0 v4l2src device=/dev/video2 ! videoconvert! videoscale ! video/x-raw, width=640, height=480, framerate=30/1 ! autovideosink -v
The above command worked for me. But how do I run this in a chromium browser?
Are you asking how to create a web app that does this?
Well for starters we provide a container that can launch a browser as documented here: Web Browser / Kiosk Mode with TorizonCore | Toradex Developer Center
But beyond that the actual application development is left for the customer to decide and design. There’s plenty of examples online of using Gstreamer in a web app like here: node.js - How to use GStreamer to directly stream to a web browser? - Stack Overflow
Depending on what you’re ultimately doing I’m sure you can find a suitable example.
Best Regards,
Jeremias