例程讲解06-Video-Recording->imageio_memory 保存和读取视频
import sensor, image, time
N_FRAMES = 500
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((120, 120))
sensor.skip_frames(time = 2000)
clock = time.clock()
stream = image.ImageIO((120, 120, 2), N_FRAMES)
for i in range(0, N_FRAMES):
clock.tick()
stream.write(sensor.snapshot())
print(clock.fps())
while (True):
stream.seek(0)
for i in range(0, N_FRAMES):
img = stream.read(copy_to_fb=True)
time.sleep_ms(10)