Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route("/start_record", methods=['POST'])
- def start_capture():
- global camera
- with camlock:
- if camera:
- return 'already started'
- camera = picamera.PiCamera()
- camera.resolution = (1920, 1080)
- camera.start_preview()
- now = get_timestamp()
- recording_name = 'recording-%i' % (now)
- recording_dir = '%s/%s' % (CONFIG['capture']['directory'], recording_name)
- mkdir(CONFIG['capture']['directory'])
- os.mkdir(recording_dir)
- camera.start_recording('test.h264')
- return 'recording'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement