def __init__(self, video_src = 0,
interactive = True,
video = 'chess.avi', fallback = 'synth:bg=./data/hi.jpg:noise=0.05', nFrames = 500):
cam = create_capture(video_src, fallback=fallback)
if not cam:
print("Problem initialising cam")
vwriter = VideoWriter(video)
run = True
t = clock()
frameCounter = nFrames
while frameCounter>0:
ret, img = cam.read()
vwriter.addFrame(img, width=1920)
frameCounter-=1
print("%d" % frameCounter)
print("Created chessboard video : saved %d frames to %s" % (nFrames, video))
vwriter.finalise()
#####################################################################################################################
# Tutorials
#####################################################################################################################
# Placeholder for snippets used in development taken from the tutorials.
评论列表
文章目录