在成功编写视频一段时间后,VideoWriter将静默地开始只创建空的视频文件。在
这是在树莓皮3上
开放式CV 2.4.9
以下脚本说明了该问题: 下面是一个独立的脚本来说明这个问题:
#!/usr/bin/pyton
import cv2
import time
import numpy
import subprocess
fourcc = cv2.cv.CV_FOURCC(*'MJPG')
allret = 0
f = numpy.ones((480,640,3), numpy.uint8)
h,w,c = f.shape
print h,w,c
counter = 0
while True:
counter += 1
print "Iteration: ", counter
time.sleep(0.1)
writer = cv2.VideoWriter("test.avi", fourcc, 5, (w,h))
for i in xrange(20):
writer.write(f)
writer.release()
writer = None
ret = subprocess.call(["avprobe","test.avi"])
allret += ret
print "FAILURES:", allret
if allret > 5:
break
在大约800个成功的视频之后,我们只能得到糟糕的视频。重新启动脚本将重新启动该过程。在
目前没有回答
相关问题 更多 >
编程相关推荐