Gstreamer to stream usb cameras with threading

I am trying to stream 2 cameras with python multithreading for the application stereo vision.
I am getting the error once after adding the camera to thread

    thread = threading.Thread(target=loopCamera)

ipdb> n
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created

and its working fine, if i try to access individual camera one by one.

Would you please let me know, where i am making mistake.

Is jetson won’t allow use of multithreading or is there any way to access the multithreaded USB cameras with gstreamer?


Not sure if OpenCV supports multiple USB cameras(V4L2 sources). Usually we run single camera like:

For multiple cameras in single process, you may go to OpenCV forum to get further help.