Is it possible to use WebRTC to streaming video from Server to Client?

A-letubby picture A-letubby · Jul 9, 2013 · Viewed 51.1k times · Source

In WebRTC, I always see the implementation about peer-to-peer and how to get video streaming from one client to another client. How about server-to-client?

Is it possible for WebRTC to streaming video file from server-to-client? (I am thinking about using WebRTC Native C++ API to create my own server application to connect to the current implementation on chrome or firefox browser client application.)

OK, if it is possible, will it be faster than many current video streaming services?

Answer

nakib picture nakib · Jul 10, 2013

Yes it is possible as the server can be one of the peers in that peer-to-peer session. If you respect the protocols and send the video in SRTP packets using VP8, the browser will play it. To help you build these components on other applications or servers, you can check this page and this project as a guide.

Now, comparing WebRTC with other streaming services... It will depend on several variables like the Codec or the protocol. But, for instance, comparing WebRTC (SRTP over UDP with VP8 Codec) against Flash (RTMP over TCP with H264 Codec), I would say that WebRTC wins.

  • The player will be Flash Player against the native <video> tag.
  • The transport would be TCP against UDP.

But of course, everything depends on what you are sending to the client.