Access IP Camera in Python OpenCV

后端 未结 11 1420
执笔经年
执笔经年 2020-11-29 01:49

How do I access my IP Camera stream?

Code for displaying a standard webcam stream is

import cv2
import numpy as np

cap = cv2.VideoCapture(0)

while(Tr         


        
11条回答
  •  被撕碎了的回忆
    2020-11-29 02:46

    To access an Ip Camera, first, I recommend you to install it like you are going to use for the standard application, without any code, using normal software.

    After this, you have to know that for different cameras, we have different codes. There is a website where you can see what code you can use to access them:

    https://www.ispyconnect.com/sources.aspx

    But be careful, for my camera (Intelbras S3020) it does not work. The right way is to ask the company of your camera, and if they are a good company they will provide it.

    When you know your code just add it like:

    cap = cv2.VideoCapture("http://LOGIN:PASSWORD@IP/cgi-bin/mjpg/video.cgi?&subtype=1")
    

    Instead LOGIN you will put your login, and instead PASSWORD you will put your password.

    To find out camera's IP address there is many softwares that you can download and provide the Ip address to you. I use the software from Intelbras, but I also recommend EseeCloud because they work for almost all cameras that I've bought:

    https://eseecloud.software.informer.com/1.2/

    In this example, it shows the protocol http to access the Ip camera, but you can also use rstp, it depends on the camera, as I said.

    If you have any further questions just let me know.

提交回复
热议问题