Reputation: 3233
I have a Teledyne Dalsa Genie Nano XL camera : connecting it to the PC it gets assigned the following IP Address: 192.168.0.20
How do I find or setup the URL Video Stream for the camera in order to access its video stream through standard opencv instruction cap=cv2.VideoCapture('url')
?
Any help will be highly appreciated
Upvotes: 0
Views: 2221
Reputation:
I assume you are trying to stream from an IP camera via rtsp. So, you can achieve it by this line of code:
Python version:
cap = cv2.VideoCapture('rtsp://admin:[email protected]:554/stream1 latency=0')
C++ version:
cv::VideoCapture cap("rtsp://admin:[email protected]:554/stream1 latency=0");
Here, the first admin
indicates the username
used to connect to your ip camera, and the second corresponds to password
. By default, rtsp connection uses 554 port, but you may refer to your camera document to double-check it.
The string :554/stream1
varies depending on your camera brand. So you should check your manual for rtsp connection string.
The parameter latency=0
means you want to stream from camera without any delay. By default, rtsp connection creates a latency for buffer (something like 2-5 seconds), and this leads to some delay from actual content.
Upvotes: 1