python for IP camera problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

python for IP camera problem

This post has NOT been accepted by the mailing list yet.
This post was updated on .
OpenCV, 2.4.9, Python 2.7

The IP Camera was an Android phone with a software which downloads from http://www.haban.cn/.

The IP Camera can be seen in FireFox by http://admin:admin@ in the WLAN. IP video's format over http is mjpeg.

And, from the HTML source, i know the jpeg file is http://admin:admin@
In browser, i can see the picture of http://admin:admin@ changing swiftly.

ref http://stackoverflow.com/questions/5968508/problem-with-python-and-ip-camera, i code this

------------------python code-------
import sys
import cv
capture =cv.CaptureFromFile(video)
cv.NamedWindow('Video Stream', 1 )
while True:
  # capture the current frame
  frame = cv.QueryFrame(capture)
  if frame is None:
    cv.ShowImage('Video Stream', frame)
  if k == 0x1b: # ESC
    print 'ESC pressed. Exiting ...'


But failure. Nothing show in the windows. Can you help me? thank you.