top of page

Adding WebRTC to your GStreamer application

Updated: Apr 17

Due to the increment of edge and IoT devices in recent years, opportunities for developers to create new technologies or improve existing ones emerge day by day, to overcome different challenges.

RidgeRun is always looking for ways to improve embedded technologies, and regarding WebRTC, a protocol that is commonly powered by browsers in local computers, have taken a turn to target embedded edge devices, such as mobile phones, drones, or surveillance cameras.


Just imagine uploading this plugin to a drone that is sending real-time video streaming information from a dangerous place to a control room full of people on the other side of the world. A good fit to situations where human lives are in constant danger, or in a less extreme case, it can be used in daily common scenarios, for instance surveillance applications, tracking applications, among others.



Figure 1. Possible applications of WebRTC


To face these challenges we have developed a WebRTC-based plugin that works with GStreamer pipelines, but first let’s give some context. WebRTC is an open standard specification for real-time communications (RTC). It usually works with mobile applications and web browsers, via simple APIs by handling peer to peer communication. More than that, it provides real time data exchange by peering techniques and low latency media streaming.


It supports video, voice, and generic data to be sent between peers, allowing developers to build powerful voice and video-communication solutions. So, why is this plugin so innovative?


Well, in the first place, this protocol is powered by web browsers and local computers. So, for your solution applications, you will need to carry a personal computer that consumes lots of resources. Fortunately, RidgeRun products usually target embedded system platforms and this plugin is not an exception.


Our current plugin, the GstWebRTCWrapper is an upgrade of our old GstWebRTC, and it is based on the GStreamer WebRTC element, webrtcbin. It can turn an embedded platform into a WebRTC compliant endpoint. It wraps this binary and extracts its best features, and at the same time, uses RidgeRun’s features. We made sure that the new element contains the best of both solutions, which some of them are:

  • Signaling mechanism developed by RidgeRun.

  • Fast prototyping. You can easily integrate it by using GStreamer pipelines as soon as you get it out of the box.

  • RidgeRun support for congestion control mechanisms, specifically REMB support. This could be very useful to control the video quality dynamically based on bandwidth availability.

  • Ability to monitor the state of the WebRTC negotiation.

You just need to build and install this plugin within your platform and start working with it. As simple as that. Some advantages that this plugin can offer to the end user are:

  • Extend existing pipeline to support WebRTC streaming

  • Use non-standard pipeline configurations

  • High performance pipeline tuning for resource critical systems

  • Dynamic stream handling in a running pipeline.

  • Fine grained pipeline control

  • Quick gst-launch prototyping


Figure 2. GstWebRTCWrapper potential applications


By using it, users can communicate directly with other computers without needing to perform extra configurations or additional steps.This plugin can also potentially help companies to build scalable advanced multimedia projects for embedded platforms. The range of opportunities to implement it is huge, some of them are:

  • Surveillance applications

  • Group chats/streaming applications

  • Remote control applications

To extend a bit the potential applications that this plugin could offer to the end user, remote control and surveillance applications are promising fields that have been progressing in recent years. More and more in person jobs are being displaced by remote control jobs, by using robots or remote control hardware, and even more if these tasks or jobs involve human danger situations and difficult access places. Why risk human life if we could send remote controlled hardware with a great communication plugin to the source of information?


To test its performance, we used the following pipeline on a x86 platform.

gst-launch-1.0 webrtcwrapperbin signaler=GstPubnubSignaler signaler::user-channel=$USER_CHANNEL signaler::peer_channel=$PEER_CHANNEL start-call=true name=web videotestsrc is-live=true ! videoconvert ! queue ! x264enc ! rtph264pay ! queue ! web.

One important measurement to show is the latency, these numbers are post it on Figure 3. This was tested on a NVIDIA Jetson Xavier AGX and a x86 computer. It can be appreciated that the latency is really low, it moves between a range of 142ms and 159ms. This latency is highly dependent on the video source, GStreamer pipeline, platform processing power and network topology. For your use case it could be higher or lower. RidgeRun can help you to optimize latency in your custom application.


Figure 3. Latency glass to glass



Figure 4. GstWebRTCWrapper working connecting to PubNub WebRTC Demo.


Figure 4 shows the plugin working on a PubNub WebRTC Demo. As you can observe, you can chat and interact trough video and audio.


Conclusion


As we have shown, this product is a great opportunity to innovate scalable solutions for a lot of applications. Connecting people with situations using embedded platforms, sending live streaming information from the active source can be done now, easier than ever before. Do not hesitate and feel free to ask for an evaluation version, and start developing great products.


You can find more information and more examples in our developer wiki https://developer.ridgerun.com/wiki/index.php/GStreamer_WebRTC_Wrapper .


For purchase details, please go to our online store in the following link https://shop.ridgerun.com/collections/all.


bottom of page