Videocapture blocked! please help

i re-compile opencv + opencv_contrib 4.5.1, with CUDA on, then i install *.so into /usr/local/, everything is ok.
BUT! my c++ program use videocapture to open a rtsp url stream, like this:
“rtsp://172.16.100.56:554/ch0.liv”
the c++ code:
cv::VideoCapture cap(input);
then i get the ERROR, the process never go , it is hang!

image

what is the problem? please help!

Hi,
Please check if you can run gst-launch-1.0 command:

$ gst-launch-1.0 uridecodebin uri=rtsp://_RTSP_IP_ADDRESS_ ! nvoverlaysink

If it works in the command, please try the python sample:
Doesn't work nvv4l2decoder for decoding RTSP in gstreamer + opencv - #3 by DaneLLL

i’m sorry , it 's not work ! look:

hang up!!

Hi,
Please share brand and model ID(ex: Hikvision DS-2CD202WF-I). And does the IP camera support H265? If it supports H265, please configure to H265 and give it a try.

nvidia jetpack origin opencv is 4.1.1, but not have contrib module, so i uninstall origin, i re-compile opencv, orgin opencv it work ok with same code, but i compiled opencv not work!
my cmake cmd like this:
cmake -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=…/…/opencv_contrib-4.5.1/modules -D WITH_GSTREAMER=ON -D WITH_GSTREAMER_0_10=OFF -D WITH_LIBV4L=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local …

so what is the problem??

Hi,
It looks to be an issue in gstreamer instead of OpenCV. Looks like the stream cannot be well decoded. If it is decodable, you should see video playback in running uridecodebin ! nvoverlaysink. We would suggest try H265 if your source can output H265 stream.