Accessing multiple cameras at once with v4l2src


The cameras work great with the DWEOS sending over a UDP stream. but I would like to do some processing locally, so I have a gstreamer pipeline setup in a python script. I am using the /dev/video0 device which is not H264 so I don’t have to decode it on the pi again. I am using v4l2src as described in the docs. Working with one camera works great, when I try to access the second camera (/dev/video4) it doesn’t work. I tried with manual gstreamer pipelines here:
gst-launch-1.0 v4l2src device=/dev/video0 ! fakesink dump=1 and gst-launch-1.0 v4l2src device=/dev/video4 ! fakesink dump=1. Running one or the other pipeline works great, but if I run both at the same time, the pipeline that starts first works, but the second just hangs, with no errors, but does not produce frames.

How do I access both (or more) cameras at once with v4l2src?

Interestingly, accessing /dev/video0 (non-h264) and /dev/video6 (h264) at the same time does work.


Hi Joshua,

Welcome to the forums! :slight_smile:

My guess would be you are maxing out on the available bandwidth of one part of your system (whether it be USB or Ethernet). There should be no issue accessing 2 cameras at once. My guess would be it works with H.264 because it uses less bandwidth than MJPEG.

Are you using a USB hub to connect the cameras?