Genie Discord forum

Author AvatarMonty Hall
3/26/2023, 1:28:48 AM

I do a fair amount of open CV stuff. I have an RGB matrix that I'd like to pump to the web browser (let say at 10hz). How can I accomplish this?

Author AvatarMonty Hall
3/27/2023, 1:31:05 AM

Looks like this is how it's done in python flask

Author AvatarMonty Hall
3/27/2023, 1:31:15 AM
#!/usr/bin/env python
from flask import Flask, render_template, Response
from camera import Camera

app = Flask(__name__)

def index():
    return render_template('index.html')

def gen(camera):
    while True:
        frame = camera.get_frame()
        yield (b'--frame\r\n'
               b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')

def video_feed():
    return Response(gen(Camera()),
                    mimetype='multipart/x-mixed-replace; boundary=frame')

if __name__ == '__main__':'', debug=True)
Author AvatarMonty Hall
3/27/2023, 1:31:37 AM
    <title>Video Streaming Demonstration</title>
    <h1>Video Streaming Demonstration</h1>
    <img src="{{ url_for('video_feed') }}">
Author AvatarMonty Hall
3/27/2023, 1:31:55 AM

Just have to figure out how to do this in genie.

Author AvatarPere
3/27/2023, 9:16:35 PM

We are discussing the same thing here

I'll update this thread once I get the code working