Hi,
I’m having trouble getting two USB cameras to work on a Jetson Nano.
I am using the formula to capture the image:
’ v4l2src device=/dev/video0’
’ io-mode=2! image/jpeg,’
’ width=(int)640, height=(int)480, ’
’ framerate=30/1 ! ’
’ nvv4l2decoder mjpeg=1 ! ’
’ nvvidconv ! videoflip method=0 ! video/x-raw,format=BGRx !’
’ videoconvert ! video/x-raw, format=BGR !’
’ appsink’
When I try to retrieve the image via opencv from only one camera, everything works fine.
When I try to download the image from two cameras through opencv I get an error:
jetson@jetson-desktop:~$ /usr/bin/python3 /home/jetson/Desktop/test_4_cameras.py
Opening in BLOCKING MODE
*Opening in BLOCKING MODE *
*NvMMLiteOpen : Block : BlockType = 277 *
*NVMEDIA: Reading vendor.tegra.display-size : status: 6 *
*NvMMLiteBlockCreate : Block : BlockType = 277 *
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=1, value=27, duration=-1
pening in BLOCKING MODE
*pening in BLOCKING MODE *
Opening in BLOCKING MODE
Segmentation fault (core dumped)
It uses python multithreading.
When I tried to open the image using command:
gst-launch-1.0 v4l2src device=/dev/video2 ! xvimagesink
for two cameras, in two terminals, the image from the first open camera is frozen when the image from the second camera is opened.
Is it possible to run two (or more) USB cameras? Or has anyone had a similar problem or knows how it should be solved?
Version: JetPack 4.5.1
Cameras used:
Arducam 4K 8MP IMX219:
Video formats:
jetson@jetson-desktop:~$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Size: Discrete 3264x2448
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 2592x1944
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 2048x1536
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 1600x1200
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 1280x960
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 800x600
Interval: Discrete 0.050s (20.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.050s (20.000 fps)
Index : 1
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : Motion-JPEG
Size: Discrete 3264x2448
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 2592x1944
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 2048x1536
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1600x1200
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x960
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 800x600
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
I also tried on another Creative VF0700 camera - the problem also occurs.
Among other things, I found this tutorial:
But I have trouble understanding how I should apply the given solution to my problem.