Browse Source

camera mode

split-pipe
Hendrik Langer 4 years ago
parent
commit
bddc90507c
  1. 1
      raspberry/requirements.py
  2. 3
      raspberry/roberto/camera/camera_pi.py
  3. 5
      raspberry/roberto/views/frontend/routes.py

1
raspberry/requirements.py

@ -4,5 +4,6 @@ python3-flask-login
python3-flask-socketio
python3-serial
python3-opencv
python3-picamera
libjs-jquery
libjs-bootstrap

3
raspberry/roberto/camera/camera_pi.py

@ -8,6 +8,9 @@ class Camera(BaseCamera):
@staticmethod
def frames():
with picamera.PiCamera() as camera:
camera.resolution = (1280, 720)
camera.exposure_mode = 'sports'
camera.framerate = 49
# let camera warm up
time.sleep(2)

5
raspberry/roberto/views/frontend/routes.py

@ -24,8 +24,11 @@ def video_feed():
"""Video streaming route. Put this in the src attribute of an img tag."""
from roberto import camera
camera.__init__()
return Response(gen(camera),
response = Response(gen(camera),
mimetype='multipart/x-mixed-replace; boundary=frame')
response.headers.add('X-Accel-Buffering', 'no')
return response
@frontend_blueprint.route('/gamepad.js')
def gamepad_js():

Loading…
Cancel
Save