【发布时间】:2011-05-11 17:57:33
【问题描述】:
我无法从我拥有的 IP 摄像机获取视频流。我正在使用 opencv 从中获取图像。这是我的代码:
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
我不是 python 专家,所以任何帮助都将不胜感激!
【问题讨论】: