简体   繁体   中英

Access IP Camera using imutils VideoStream

I'm using the line below to fetch video stream from my laptop camera and it works great.

vs = VideoStream(src=0).start()

But now, I want the source to be an IP Camera and not my laptop camera. Is there a way like just changing the src to the IP of the camera? I've searched all over and what I mostly saw was using the cv2 VideoCapture method. I'm wondering if that solution will also work with VideoStream function.

Thanks!

First make a variable, setting login credentials of IP camera. Example

rtsp_url = "rtsp://name:password/video"
vs = VideoStream(rtsp_url).start()

I've made it work.

For future references, yes. The method used by cv2 VideoCapture function also works on imutils' VideoStream function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM