6

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!

Elmo F.
  • 71
  • 1
  • 3

2 Answers2

3

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

rtsp_url = "rtsp://name:password/video"
vs = VideoStream(rtsp_url).start()
edbighead
  • 5,607
  • 5
  • 29
  • 35
1

I've made it work.

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

Elmo F.
  • 71
  • 1
  • 3
  • I've tried passing in the ip address of the camera like this:. `VideoStream(src='rtsp://abc.de.fg.h').start()` but it still doesn't work. It just defaults to my webcam. Please what exactly did you do? – Xceptions May 15 '20 at 12:50
  • I've solved my issue. I rewrote everything using cv2. – Xceptions May 16 '20 at 11:34