Problems with RTSP video in Python

hello. I’m implementing a function to read and output rtsp video using python’s cv2.videocapture().

The implementation is accessing 4 different cameras and displaying each one on a single screen.

However, I’m not getting any video output. I think this has more to do with jetson than camera issues. Here’s the rationale.
(Currently using: jetpack 6, cuda 12.2, cudnn8.6.2, opencv 4.9.0 with cuda)

  1. in a Window environment, I get the screen output (using the same source and no password).
  2. when I run this source on Linux, only 2 videos are output.
  3. it worked fine with jetpack 5 (cuda 11). (Maybe something changed with the jetpack update?)
  4. locally connected camera outputs the same 4 videos at once without any problem.
  5. when I output the same video from an external camera, it only outputs 3 videos and not one.

Hi,

For the camera basic functionality first needs to check the device and driver configuration.
You can reference to below program guide for the detailed information of device tree and driver implementation.

Please refer to Applications Using V4L2 IOCTL Directly by using V4L2 IOCTL to verify basic camera functionality.

Once confirm the configure and still failed below link help to get log and some information and some tips for debug.

Thanks!

Thank you for your response.

This answer appears to be for a directly connected camera, so I’m going to use the

Do you need to check the rtsp camera V4L2 first?

Hi,
There is no sample for launching multiple RTSP sources. You may try

  1. Try the sample and see if each source can be launched successfully:
    Doesn't work nvv4l2decoder for decoding RTSP in gstreamer + opencv - #3 by DaneLLL
  2. Apply the pipeline to the sample and see if two RTPS sources(cap and cap1) works:
    Issue with multi-camera gstreamer capture using OpenCV - #6 by DaneLLL
  3. Add cap2 and cap3 for launching 4 sources

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.