live-video-webrtc-broadcasting-review

Running a WebRTC Online Broadcasting Using a Web Camera and a VPS Server

WebRTC today is a bleeding edge technology for audio and video streaming in a browser. Traditional technologies such as HTTP Streaming and Flash are more suitable for broadcasting of a pre-recorded content (video on demand) and fall significantly short of WebRTC when it comes to real-time online broadcasting, that is, when minimum video latency is required to provide live broadcasting

Quality real-time communication is resulting from the very architecture of WebRTC that performs transport of video streams via the UDP protocol, a de facto standard in minimum-latency video transferring widely used in real-time communication systems.

webrtc-low-latency-streaming

Communication delay is a crucial parameter in online broadcasting systems, webinars and other applications where certain interaction with the sourceof the video, a lector or a narrator, is presumed. A conventional system based say on Flash may show video and audio delays up to several seconds long, that is, when spectators hear and see what the narrator said several seconds ago. Surely, this may be acceptable for some systems, but more often such an issue annoys end users and therefore requires a solution.

Another weighty reason to try WebRTC is undoubtedly a trend. Today, every Android Chrome browser supports this technology out of the box, which guarantees million devices ready to watch the broadcasting with no need to install any additional software or do any configuration.

To put WebRTC through paces and run a simple online broadcasting, we used Flashphoner WebRTC Media & Broadcasting Server software. At the features page we denoted the ability to broadcast WebRTC streams in the “one-to-many” mode and the support for IP-cameras and video serveillance systems through the RTSP protocol. In this article we will focus on web-web broadcasts and their specifics.

 

 

Installing WebRTC Media & Broadcasting Server

Since there were no WebRTC server for Windows available, and we didn’t want to install a virtual machine like VMWare, we weren’t able to test online broadcasting on a typical Windows home PC. To save time, we decided to get a cloud server instance, like the one below:

webrtc-webinars-hosting-vps-server

That was Centos x86_64 version 6.5 without any pre-installed software located in a data-center in Amsterdam. Therefore, all we got was a server and an ssh access to it. For those who is familiar with Linux console commands, WebRTC-server setup promises to be fast and painless. So, here is what we did:

1. Downloaded the installation package from the server:

$wget https://flashphoner.com/download-wcs5-server.tar.gz

2. Extracted gz contents:

$tar -xzf download-wcs5-server.tar.gz

3. Install:

$cd FlashphonerWebCallServer

$./install.sh

During the installation process we specified IP address of the server: XXX.XXX.XXX.XXX

4. Activated license:

$cd /usr/local/FlashphonerWebCallServer/bin

$./activation.sh

5. Started the server:

$service webcallserver start

6. Checked the logs:

$tail - f /usr/local/FlashphonerWebCallServer/logs/flashphoner_manager.log

7. Checked, if the server has started and is ready to work:

$ps aux | grep Flashphoner

 

Testing WebRTC online broadcasting

Testing of the broadcasting was a piece of cake. The testing looked as follows:

1. Open the test client page http://host:9091 Streaming Min or Streaming UI in the Chrome browser: http://192.168.1.3:9091

 

webrtc-server-start-stream

2. To start broadcasting you should click the “Start” button in the center of the screen.
Before you do, make sure the camera is online and ready. There are no any specific requirements to a web-camera; we used a standard built-in notebook webcam having the resolution of 1280×800.

 

webrtc-server-request-camera-and-microphone

The Chrome browser  always asks to allow access to the camera and the microphone for a user to clearly understand that his video is going to be sent to an Internet-server and he must permit that. 

3. The interface displays a successful broadcasting of a video stream from the camera to the WebRTC server. The indicator in the upper right corner that the stream goes to the server, the “Stop” button in the lower corner allows to stop transmitting the video.

Screen_Shot_20140618_at_40939_PM

Please take a look at the link in the lower box. It contains a unique id of the stream, so anyone can join watching it simply opening the link in a browser. To copy the link into the clipboard, click the “Copy” button.

In real applications like webinars, lectures, online video broadcasts or interactive TV developers will have to implement sending the id of the stream to certain groups of spectators to allows the watch streams they want. Though, this comes down to program logic of the application. WebRTC Media & Broadcasting Server does not interfere with it, and merely dispenses the video.

4. After openning the link in a browser, you have to wait a little. Few seconds are required to establish connection with the server via Websockets, create a WebRTC session and fetch the stream.

webrtc-server-preparing-video-playback

5. The connection is established, and a spectator sees the videostream on the screen. Now he or she can send the link to someone else, stop the playback or switch to fullscreen using the bottom right controls.

Screen_Shot_20140618_at_41131_PM

 

WebRTC-server online broadcasting testing results

During testing, the latency was nearly perfect. Ping to the data-center was about 100 ms and the delay wasn’t recognizable with a naked eye. Therefore, we can assume the real delay is the same 100 give or take few dozens of milliseconds for buffering. Comparing with Flash video, WebRTC performs better in this kind of tests. For instance, if you move your hand, Flash stream displays the movement in one or two seconds after given the same network conditions.

As for quality, there were blocks on the footage visible during fast movements. This is due to the nature of the VP8 codec and its main purpose – to provide real-time video communication with acceptable quality and low latency.

The server is quite simple to install and to configure. It doesn’t require any serious skills except general knowledge of Linux on the advanced user level, ability to execute ssh commands and work with a text editor. As a result, we successfully set up online “one-to-many” broadcasting between browsers. Additional spectators connecting to the stream didn’t cause any problems.

The quality of the broadcasting was acceptable for webinars and online conferences. The only questionable thing was resolution of the video. The camera supports 1280×800, but the resolution of the test picture looks more like 640×480. It seems this issue need further clarification with the developers.

Also, we recommend reading our article on configuration and testing of WebRTC & Broadcasting Server with IP-cameras and video surveillance systems working through RTSP.

 

Video tutorial of a web cam broadcasting
through the WebRTC server

 

More about WebRTC server

Learn more about WebRTC Server for a browser based broadcasting
Learn more about WebRTC Server for IP cameras and video surveillance systems
Read how to run a browser-based WebRTC broadcasting
Read how to set up video surveillance via WebRTC using an IP-camera an a VPS server
Learn more about the Web Call Server platform
Read the manual
Visit support forums
Download WebRTC Media Server

 

Download Web Call Server 5

System requirements: Linux x86_64, 1 core CPU, 2 Gb RAM, Java

    Download Now    

Installation:

  1. wget https://flashphoner.com/download-wcs5.2-server.tar.gz
  2. Unpack and install using 'install.sh'
  3. Launch server using command 'service webcallserver start'
  4. Open the web interface https://host:8444 and activate your license

 

If you are using Amazon EC2, you don't need to download anything.

Launch WCS5 on Amazon EC2

 

Web Call Server 5 - Trial

The 30-days license is provided once for a person or organization. Please use your corporate email.


Processing...

 

Related articles

iOS Safari 11 now supports WebRTC

Oh, latency, thou art a heartless bitch

Broadcast video stream from web page to Facebook and YouTube simultaneously

Deployment multiplayer webrtc technology broadcast with a web camera via server in 3 minutes

 

Related features

Broadcasting a WebRTC video stream with re-publishing as RTMP

Video broadcasting from the web camera of a browser or mobile device