Skip to content

Instantly share code, notes, and snippets.

Last active May 7, 2022 01:39
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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)
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment