Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

fail reading data from rtsp stream with opencv python

i have problem in useing opencv python when reading rtsp stream, this works fine:

cv::VideoCapture video_cap;
video_cap.open("rtsp://admin:62283118@10.102.6.65//Streaming/Channels/1?tcp");

but when i use python, it doesn't work, my python code is

video_cap = cv2.VideoCapture("rtsp://admin:62283118@10.102.6.65//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?

fail reading data from rtsp stream with opencv python

i have problem in useing opencv python when reading rtsp stream, this works fine:

cv::VideoCapture video_cap;
video_cap.open("rtsp://admin:62283118@10.102.6.65//Streaming/Channels/1?tcp");
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:62283118@10.102.6.65//Streaming/Channels/1?tcp");
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?