I'm trying to connect to a RTSP camera via OpenCV using VideoCapture from opencv-python and i get the following error ONLY IN PYTHON3, IT WORKS NORMALLY IN PYTHON2:
[tcp @ 0x1d0a4ac0] Port missing in uri
Unable to open
The code:
import cv2
endpoint = "rtsp://<user>:<password>@192.168.<ip>.<ip>:554/cam/realmonitor?channel=1&subtype=0"
cap = cv2.VideoCapture(endpoint)
if not cap.isOpened():
print("Unable to open")
else:
print("Open")
What I've tried:
- Reinstalling opencv-python
- Reinstalling Python and all it's dependencies and packages (
apt install python-opencv
) - Checking the RTSP connection and authentication (It works fine only in Python2)
- Checked for Port missing in uri warning: Error opening file with Python OpenCV cv2.VideoCapture()
- Checked for cv2.videoCapture only return "Port missing in uri"
I'm running this in a NVidia Jetson Xavier AGX running Ubuntu.
Any suggestion to fix this will be welcome
(And, YES, I NEED it to run on Python3)