ルーチン説明 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)