Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# -*- coding: utf-8 -*-
#!/usr/bin/python
import datetime,picamera
def recordVideo():
try:
with picamera.PiCamera() as camera:
camera.framerate = 25
camera.annotate_background = picamera.Color('black')
camera.resolution = (640, 480)
camera.start_preview()
camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
camera.start_recording('%s.h264' % file_name) # dosya formatı
camera.wait_recording(60*60) # 1 saat kayıt yap
camera.stop_recording()
except Exception as st:
print str(st)
if __name__ == "__main__":
recordVideo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.