I'm trying to figure out the best way of doing the following things:
(A) Capture video frames in a client PC using a web browser (e.g. Chrome / Chromium).
(B) Send them to a server machine running a C++ processing algorithm (e.g. an OpenCV-based mutant squirrel detection routine).
(C) Send processing results back to the browser in the client PC in order to show them (real time would be nice, but overall latency is of course expected).
What I have discovered so far is that WebRTC is great for doing (A) (getUserMedia(), etc..) and, in theory, (B). My problems arise when it comes to send data to a C++ server. I have been looking to the basics of WebRTC (including the examples for P2P communication and the Native C++ API documentation) but I still have no clues on how to start building my server and send the data from the browser. Although I have little experience in Javascript, I have already worked in similar scenarios (Javascript Client <--> C++ Server with webSockets), but I though the webRTC solution should be even easier to implement.
Am I right about using webRTC for this scenario? Am I missing something? Is there any tutorial or example covering my scenario that I have missed?
From your post, I understand you need a WebRTC C Client to stablish a RTCPeerConnection between the C-client and the browser. After that, you can process the stream and return it to the browser using another RTCPeerConnection.
I don't work usually with C/C++ but check this repository: https://github.com/mozilla/webrtc-standalone , perhaps it can be useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With