Ask Your Question
1

How do I live stream wifi camera using python opencv ?

asked 2016-12-05 01:15:32 -0600

pinkflamenco gravatar image

I have a project for my university to use python but the thing is I'm an absolute beginner at this. I've found several post through google but I can't seem to get it streaming. I managed to stream using usb webcam but wifi camera seems so much more complicated. I really appreciate any help.

edit retag flag offensive close merge delete

Comments

and the actual problem is ?

berak gravatar imageberak ( 2016-12-05 01:50:00 -0600 )edit

I can't stream using wifi camera. Usb webcam seems easy enough by using

cap = cv2.VideoCapture(0)
pinkflamenco gravatar imagepinkflamenco ( 2016-12-05 02:52:33 -0600 )edit

sorry, but we can't help without more detail. what kind of camera is it, what kind of url do you try, does it need authentification, lalala.

berak gravatar imageberak ( 2016-12-05 04:58:15 -0600 )edit

I'm using Yi camera 1.Model YDXJ_v22L. Firmware version 1.2.13 I manage to stream through vlc by using url rtsp://192.168.42.1/live

pinkflamenco gravatar imagepinkflamenco ( 2016-12-07 22:38:40 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-12-06 10:41:59 -0600

Math gravatar image

An Ip Camera (WiFi) needs a rtsp protocol, so you have to change the zero.

cap = cv2.VideoCapture("rtsp://user:[email protected]:554/cam/realmonitor?channel=1@subtype=1")

Dahua sells a compatible camera with OpenCv.

edit flag offensive delete link more

Comments

without camera name you cannot know if protocol is rtsp http ...

LBerger gravatar imageLBerger ( 2016-12-06 15:11:42 -0600 )edit

I'm using Yi camera 1.Model YDXJ_v22L. Firmware version 1.2.13

I manage to stream through vlc by using url rtsp://192.168.42.1/live

pinkflamenco gravatar imagepinkflamenco ( 2016-12-07 22:37:42 -0600 )edit
0

answered 2019-12-04 06:34:35 -0600

To use the IP Cam's Stream on your python program, you have to find the URL of the Video Stream. This URL is differ based on manufactures. You can easily Find the URL of video stream from these Website

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

there will be lots of URL formats. Select the Brand of you IP Cams and try the one by one in your python program.

Dahua is Here in my case,

My Code to capture and play the Video from the IP cam is Shows Below . (Username and Password of my IP cam is Both admin, admin)

import cv2

while True: cap = cv2.VideoCapture('http://admin:[email protected]/cgi-bin/snapshot.cgi?loginuse=admin&loginpas=admin')

ret, frame = cap.read()
cv2.imshow('image', frame)
cv2.waitKey(1)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-12-05 01:15:32 -0600

Seen: 9,492 times

Last updated: Dec 06 '16