Im trying to access rtsp stream using cv2 and gstreamer pipeline in python.
I tried running the gst-launch in terminal and it worked perfectly, but when I try to use gstreamer in cv2, it won’t open the pipeline.
gst-launch command I used gst-launch-1.0 rtspsrc location=rtsp://192.168.42.120:554/snl/live/1/1 latency=0 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink
I was only able to open cv2 and get frames using cv2.VideoCapture("rtsp_uri"), any other parameters to VideoCapture() (ie: cv2.CAP_GSTREAMER) will have cam.isOpened() to return False
The problem turns out to be not having gstreamer plugin installed for opencv when I use pip3 install opencv-python.
After building cv from source (OpenCV: Install OpenCV-Python in Ubuntu), I was able to open the pipeline and get super low latency stream with