First of all, thank you for your attention. I'm trying to stream with opencv and ip camera, but it only returns "[tcp @ 000001d5fce13580] Port missing in uri". I have already tested on VLC and also tested with JavaCV and it works on both. I already checked the MPEG and it's OK. Has anyone been through this and can help?
I am with:
- WIN10
- OpenCV 4.5.1
CODE:
import numpy as np
import cv2
def runCam():
print(cv2.getBuildInformation())
video_src = "rtsp://admin:myPWCam@192.168.1.223:554/Streaming/channels/1/"
cap = cv2.VideoCapture(video_src, cv2.CAP_FFMPEG)
while True:
ret, frame = cap.read()
try:
cv2.resizeWindow('Stream IP Camera OpenCV', 120300, 800)
cv2.imshow('Stream IP Camera OpenCV', frame)
except Exception as ex:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
print(message)
break
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
runCam()
OPENCV BUILD INFO: https://gist.github.com/nathancn/745f543e3a6cd13d012855759bd0940d
I USE HIKVISION IP CAM MODEL DS-2CD2621G0-IS