def gen_frame(): """Video streaming generator function.""" while True: frame = camera_stream() yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n' ) # concate frame one by one and show result
def gen_frames(): while True: frame = camera_stream() yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
def save_frame(): frame = camera_stream() with open('dataset/hello.jpg', 'wb') as f: f.write(frame) """Video streaming route. Put this in the src attribute of an img tag.""" return Response('hello')