fail reading data from rtsp stream with opencv python [closed]
i have problem in useing opencv python when reading rtsp stream, this works fine:
cv::VideoCapture video_cap;
video_cap.open("rtsp://admin:pw@ip//Streaming/Channels/1?tcp");
but when i use python, it doesn't work, my python code is
video_cap = cv2.VideoCapture("rtsp://admin:pw@ip//Streaming/Channels/1?tcp");
print(video_cap.isOpened())
and i had tested this:
video_cap = cv2.VideoCapture(0);
print(video_cap.isOpened())
it works fine too, I don't know why? Anyone can tell me?
os, opencv version ? how did you install it ? (esp. the python version!)
2.4.13, I moved “cv2.pyd” in (the path python.exe exists)/Lib/site-packages
how did you install it ? (if it was via PIP - no ffmpeg support builtin, hence no ip-capture possible)
(and why on earth outdated 2.4 ?)
no, I didn‘t install it by pip, I just put "cv2.pyd" in python env. and is opencv 2.4.13 outdated? it's just released in 2016... and i run python code
and i get result like
oh, that's on win, missed that.
make sure opencv_ffmpeg.dll is on your PATH (or next to where you run the script)
wow, it works, thanks, bro