webrtc-working-example icon indicating copy to clipboard operation
webrtc-working-example copied to clipboard

Add WebRTC data sending (chat/files)

Open pfertyk opened this issue 3 years ago • 4 comments

pfertyk avatar Jun 05 '22 20:06 pfertyk

According to your implementation, I can send video stream data to the server. Would it be possible to get the response back to the same client who sent the stream in the first place? Thanks, Tomer

tomermesser avatar Nov 21 '22 08:11 tomermesser

Hi! In this issue, I meant "data" as one of the types handled by WebRTC. There are 3 of them: audio, video, and data. The last one allows sending e.g. text messages or any files actually. I think it would be a nice addition to this repo ;)

By "send video stream data to the server" did you mean sending the video stream from your own camera to the other recipient? If so, this can already be displayed locally (one of the recent commits added a local stream display in web and mobile versions). If this is not what you meant, could you please clarify?

Cheers, Paweł

pfertyk avatar Nov 21 '22 23:11 pfertyk

Hi Paweł and thank you for responding so quickly!

I meant to send video stream data directly to the server by grabbing the video frame data from the client (client 1) and then streaming it directly to the server using Navigator.mediaDevices.

Each frame would be manipulated by the server using OpenCV and then sent back to the same client (client 1).

I am looking to create kind of "full-duplex communication" between client 1 -> server -> client 1. Is it possible ? I will really appreciate your answer.

Thanks, Tomer

tomermesser avatar Nov 22 '22 09:11 tomermesser

Hi!

Thank you for clarifying. What you described is probably possible, but not with the current implementation. This project focuses on using WebRTC that is already implemented in web browsers and mobile devices. What it provides is the minimal amount of JS configuration (with Python server handling the signaling) and the rest (including audio/video processing) is handled natively. I think you would need to dig into the implementation to capture single frames and process them with OpenCV. That is beyond the scope of a "simple working example" that this repo is intended to be ;)

Sorry I couldn't help more.

Cheers, Paweł

pfertyk avatar Nov 23 '22 22:11 pfertyk