Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streaming Media to Server using web socket

I am a newbie to WebRtc. I would like to send the media stream from client ( java script) to my server (via websockets). In my server I will be doing some processing on those media content.

Could you please show me a client code snippet on sending media stream to Server via websocket.

Thanks Ganesh.R

like image 786
Ganesh R Avatar asked Sep 01 '25 02:09

Ganesh R


1 Answers

Nobody can show you this, because you cannot send the stream via Websockets. You need to read a little more about WebRTC.

WebRTC give you the possibility to request access to media devices from Javascript, and allows you to create a PeerConnection that will establish a connection to another endpoint to send the streams captured from the devices or some raw data (using DataChannel). You won't have access to the streams data to send via WebSockets. Instead, the browser will send it over UDP or TCP using the SRTP protocol. If you want to get media streams on server side, you will need to implement this protocol and some negotiation to establish the connection.

HTML5Rocks have a great introduction with code snippets to start.

like image 176
nakib Avatar answered Sep 03 '25 15:09

nakib