I am trying to use the picamera API and Flask to implement a pure Python (live) stream of the continuous JPEG from the Raspberry Pi camera module to display it using a HTML template but I keep getting a "404 not found error"?
I'm a bit inexperienced with this particular subject, apologies in advance.
app.route('/test/')
def vid():
with picamera.PiCamera() as camera:
stream = io.BytesIO()
for foo in camera.capture_continuous(stream, format='jpeg'):
stream.truncate()
stream.seek(0)
if process(stream):
break
Here is the HTML code:
<img src="{{ url_for('vid') }}"width='950px' height='450px'>