jetson tx2 failed to open any camera

Hi,

I have installed opencv 3.4 into jetson tx2 however when I want test to open camera (I tired with web cam and IP camera). It keep promp select timeout, I tried switching with /dev/video0 and /dev/video1 but it have no use. It keep promp-ing:

VIDEOIO ERROR: V4L: Property <unknown property string>(38) not supported by device
libv4l2: error setting pixformat: Device or resource busy
VIDEOIO ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT

Does anyone know how to solve it?

Thanks!

Hi nerd_guy,

Could you confirm the web cam and IP camera do work well without OpenCV first?

Then you may check if OpenCV do install well on device, please see below blog by other developers, which contains many useful information as your reference:
https://jkjung-avt.github.io/opencv3-on-tx2/

Thanks

Hi kayccc,

After troubleshoot for awhile i manage to stream IP camera however, for web cam I am still unable to stream out. I have tried using gstreamer to display but still have no luck.

Thanks!

Assuming your webcam is USB, you may check it has a working driver by running this from a terminal and look at what shows up when you plug the webcam in:

watch -n 1 'lsusb && ls /dev/video*'

A few seconds after plugging your camera in, if you see a /dev/videoX appearing, then you probably have a working driver for your webcam. If not, you may note the USB id (xxxx:yyyy) appearing when you plug the camera in and google for the driver this device needs.

If it works, say if /dev/video1 appears (/dev/video0 is the onboard camera on Jetson devkit), then you can try default resolution/format with:

gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! xvimagesink

It should show your camera capture in a X window.

If this doesn’t work, or if you want to use a different resolution, you may first check what resolutions/formats your camera provides through V4L interface:

#if not yet done, install package v4l-utils
sudo apt-get update
sudo apt-get install v4l-utils 

# Query available formats for your webcam
v4l2-ctl -d /dev/video1 --list-formats-ext

Then you may try to use gstreamer and plugin v4l2src and try one of the available resolution/format.

gst-launch-1.0 v4l2src device=/dev/video1 ! 'video/x-raw, format=<your_cam_mode_format>, width=<your_cam_mode_width>, height=<your_cam_mode_height>, framerate=<your_cam_mode_framerate>' ! videoconvert ! xvimagesink

#For example if it shows 640x480@30fps in BGR format:
gst-launch-1.0 v4l2src device=/dev/video1 ! 'video/x-raw, format=BGR, width=640, height=480, framerate=30/1' ! videoconvert ! xvimagesink