电脑使用手机当webcam

电脑使用手机当webcam

硬件

电脑

安卓手机

wifi网络

软件

步骤

手机打开droidcam

电脑chrome打开http://192.168.1.103:4747/video,应该能显示webcam内容

关闭chrome(这个一定要做,应该是这个webcam不能同时多人访问)

python运行如下脚本

import cv2

#cap=cv2.VideoCapture(0)
cap = cv2.VideoCapture('http://192.168.1.103:4747/video')

while(True):
    ret,frame=cap.read() #change car -> cap
    cv2.imshow('Its Me', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
    #print (ret)

cap.release()
cv2.destroyAllWindows()    

image-20201107230949141

QA

ip camera protocol

opencv videocapture supported formats

RTSP or HTTP protocol

capture = cv2.VideoCapture('rtsp://192.168.1.64/1')
capture = cv2.VideoCapture('rtsp://username:password@192.168.1.64/1')

how to get web camera URL?

As mentioned above by @Gustavo GeoDrones you can find your Cam URL using https://www.ispyconnect.com/sources.aspx.

Go to the website, click on the model of your camera and a “Cam Video URL Generator” will appear. Insert your IP, username, etc. and click on “generate”.

Cam URL for my Canon VB-H45 is (of course with my specific username, password and IP):

http://username:password@IP/-wvhttp-01-/video.cgi

The final code:

cap = cv2.VideoCapture('http://username:password@IP/-wvhttp-01-/video.cgi')

小米智能攝像機有没有 URL

没找到

Powered by Jekyll and Theme by solid

本站总访问量