I am currently using webcam-easy.js to stream my PC's webcam to a Flask Server and display that stream.
What I would like to do is take that video feed and stream it to another server running OpenCV.
Here is my app.py:
from flask import Flask, render_template, send_from_directory, Response
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ == '__main__':
app.run()
And this is my index.html, where I am getting the video stream:
<script type="text/javascript" src="https://unpkg.com/webcam-easy/dist/webcam-easy.min.js"></script>
<video id="webcam" autoplay playsinline width="640" height="480"></video>
<canvas id="canvas" class="d-none"></canvas>
<audio id="snapSound" src="audio/snap.wav" preload = "auto"></audio>
<script>
const webcamElement = document.getElementById('webcam');
const canvasElement = document.getElementById('canvas');
const snapSoundElement = document.getElementById('snapSound');
const webcam = new Webcam(webcamElement, 'user', canvasElement, snapSoundElement);
webcam.start()
.then(result =>{
console.log("webcam started");
})
.catch(err => {
console.log(err);
});
</script>
So, how would I go on about streaming that webcam feed to another OpenCV Server?