2
我有问题从我的IP摄像头获取视频流。我使用opencv从它获取图像。这里是我的代码:Python和IP摄像头的问题
import sys
import cv
video="http://prot-on.dyndns.org:8080/video2.mjpeg"
capture =cv.CaptureFromFile(video)
cv.NamedWindow('Video Stream', 1)
while True:
# capture the current frame
frame = cv.QueryFrame(capture)
if frame is None:
break
else:
#detect(frame)
cv.ShowImage('Video Stream', frame)
if k == 0x1b: # ESC
print 'ESC pressed. Exiting ...'
break
实际上,这个东西的工作原理,但它需要太多的时间来显示图像。我猜这是因为ffmpeg的这个错误。
[mjpeg @ 0x8cd0940]max_analyze_duration reached
[mjpeg @ 0x8cd0940]Estimating duration from bitrate, this may be inaccurate
我不是一个蟒蛇专家,所以任何帮助,将不胜感激!