I uses the following sample code to capture RTP stream from IP camera. But it freezes.
string gstStr = “rtspsrc location=rtsp://192.168.50.253:8554/test latency=200 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! appsink”;
VidecoCapture capture(gstStr, CAP_GSTREAMER);
Mat captureFrame;
capture.read(captureFrame);
Thanks for your reply! I can launch the following pipeline on NX.
gst-launch-1.0 rtspsrc location=rtsp://192.168.50.253:8554/test latency=200 ! rtph264depay ! nvv4l2decoder ! nvoverlaysink
I have replaced GStreamer command according your suggestion and doing overnight testing to see if capture frame freezing issue is solved .
OpenCV VideoCapture without GStreamer enabled doesn’t have freezing issue.
VidecoCapture capture(“rtsp://192.168.50.253:8554/test”);
Mat captureFrame;
capture.read(captureFrame);