Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Processing video data captured with WebRTC (Socket.IO) in a C++ server

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?

like image 482
Яois Avatar asked Nov 01 '22 03:11

Яois


1 Answers

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.

like image 78
raposo Avatar answered Nov 15 '22 03:11

raposo