Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @app.route("/start_record", methods=['POST'])
  2. def start_capture():
  3. global camera
  4. with camlock:
  5. if camera:
  6. return 'already started'
  7. camera = picamera.PiCamera()
  8. camera.resolution = (1920, 1080)
  9. camera.start_preview()
  10. now = get_timestamp()
  11. recording_name = 'recording-%i' % (now)
  12. recording_dir = '%s/%s' % (CONFIG['capture']['directory'], recording_name)
  13. mkdir(CONFIG['capture']['directory'])
  14. os.mkdir(recording_dir)
  15. camera.start_recording('test.h264')
  16. return 'recording'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement