Skip to content

Instantly share code, notes, and snippets.

@EspaceRaspberryFrancais
Last active March 28, 2018 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EspaceRaspberryFrancais/948e0c4effeada4729636d869493a2ca to your computer and use it in GitHub Desktop.
Save EspaceRaspberryFrancais/948e0c4effeada4729636d869493a2ca to your computer and use it in GitHub Desktop.
import os
import picamera
import time
camera = picamera.PiCamera()
#Retourner image : Enlever les deux hashtag suivants
#camera.hflip = True
#camera.vflip = True
dureeVideo = 5
nomVideo = time.strftime("%d.%m.%Y-%Hh%Mm%Ss")
camera.start_recording(nomVideo+".h264")
print("REC...")
time.sleep(dureeVideo)
camera.stop_recording()
commande = "MP4Box -add "+nomVideo+".h264 " + nomVideo+".mp4"
os.system(commande)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment