Instantly share code, notes, and snippets.

Embed
What would you like to do?
picamera video
import os
from time import sleep
import picamera
camera = picamera.PiCamera()
camera.hflip = True
camera.vflip = True
i = 0
while os.path.exists('/home/pi/Downloads/video_{}.h264'.format(i)):
i += 1
while True:
video_name = '/home/pi/Downloads/video_{}.h264'.format(i)
print('Recording video' + video_name)
camera.start_recording(video_name)
sleep(10)
camera.stop_recording()
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment