0

I deployed a WebApp based on a Python Flask server. It contains javascript which allows users to access their own camera from the website (via getUserMedia).

I like to feed and process this video stream directly on client-side by using python libraries (e.g. open-cv). However, I believe the python-code is executed server-side (I couldnt find an exact reference, I am new to WebDev).

I want to avoid streaming the video to the server first and then processing it. I already tried this and am not satisfied because of quality loss and latency issues.

EDIT: turns out it is not possible! I have been using WebSockets for streaming the video to a server instead. However, the streaming is encoded in base64 and now you probably know why this su***. I defintely want to avoid WebRTC because all examples I found online are outdated...

Azrion
  • 117
  • 2
  • 14
  • 1
    99.9% of the time, when you're talking about servers and clients, all the data is being transfered from the server yes. And it's only rendered client side. There are some JavaScript libraries (javascript executes on client side) for manipulating video streams as well as Python for the browser (https://brython.info/) but I haven't tested that with video encoding. I think what you're left with is either do it in Javascript or deploy an application/plungin on the clients. Or send it to the server for processing. – Torxed Mar 17 '21 at 19:27
  • Thank you! brython seemed promising but you cant implement libraries like open-cv as decribed here: https://stackoverflow.com/questions/42204667/how-to-work-with-opencv-python-library-using-brython I guess I have to deal with processing on the server then. woohoo...! :-) – Azrion Mar 17 '21 at 19:34
  • I think so yea. Unless you use webassemly and C-code I guess :) – Torxed Mar 17 '21 at 20:03

0 Answers0