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

Webrtc

Webrtc Problem Overview


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?

Webrtc Solutions


Solution 1 - Webrtc

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.

Solution 2 - Webrtc

I have written some apps and plugins using the native WebRTC API, and there isn't a lot of information out there yet, but here are a few useful resources to get you started:

QT Example: <http://research.edm.uhasselt.be/jori/qtwebrtc><br> Native to Browser example: <http://sourcey.com/webrtc-native-to-browser-video-streaming-example/>

Solution 3 - Webrtc

I started with the WebRTC Native C++ to Browser Video Streaming Example but it doesnot build anymore with the actual WebRTC Native Code.

Then I made modifications merging into a standalone process :

  • management of the peerConnection (the peerconnection_server)
  • access to Video4Linux capture (the peerconnection_client).

Removing the stream from browser to the WebRTC Native C++ client give a simple solution to access throught a WebRTC browser to a Video4Linux device that is available from GitHub webrtc-streamer.

Live Demo

Solution 4 - Webrtc

We are attempting to replace MJPEGs with Webrtc for our server software and have a prototype module for doing this using a smattering of components tied to the Openwebrtc project. It has been an absolute bear to do, and we have frequent ICE negotiation errors (even over a simple LAN), but it mostly works.

We also built a prototype with the Google Webrtc module, but it had many dependencies. I find it easier to work with the Openwebrtc modules because Google's stuff is so tightly tied to general peer-to-peer scenarios on the browser.

I compiled the following from scratch:

libnice 0.1.14 gstreamer-sctp-1.0 usrsctp

Then I have to interact with libnice a bit directly to gather candidates. Also have to write out the SDP files by hand. But the amount of control--being able to control the source of the pipeline--makes it worthwhile. The resulting pipeline (with two clients off one server source) is below:

resulting webrtc pipeline

Solution 5 - Webrtc

Of course. I'm writting a program using native WebRTC api which can join the conference as a peer and record both video and audio.

see: https://stackoverflow.com/questions/23449666/how-to-stream-audio-from-browser-to-webrtc-native-c-application/40783725#40783725

and you can definitely streaming media from native app.

I'm sure you can use dummy_audio_file to streaming audio from local file, and you can find a way to access the video streaming progress by your own.

Solution 6 - Webrtc

Yes it is. We have developed an load test tool to publish and play for Ant Media Server. This tool can broadcast media file. We used the same native WebRTC library used in Ant Media Server.

Solution 7 - Webrtc

Sure it's possible, it allows covert live streaming to WebRTC, for example:

OBS/FFmpeg ---RTMP---> Server ---WebRTC--> Chrome/Client

For this scenario, it allows the ultra low latency live streaming, about 600~800ms, to play the live streaming by WebRTC. Please take a look at this demo.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionA-letubbyView Question on Stackoverflow
Solution 1 - WebrtcnakibView Answer on Stackoverflow
Solution 2 - WebrtcKamoView Answer on Stackoverflow
Solution 3 - WebrtcmpromonetView Answer on Stackoverflow
Solution 4 - WebrtcmprView Answer on Stackoverflow
Solution 5 - WebrtcsimpxView Answer on Stackoverflow
Solution 6 - WebrtcmgctView Answer on Stackoverflow
Solution 7 - WebrtcWinlinView Answer on Stackoverflow