Search Unity

Stream high-quality real-time graphics through your browser with our new WebRTC framework

, September 17, 2019

Now you can develop applications that take advantage of Unity’s rapidly advancing graphics capabilities without being constrained by device performance. Our new open-source WebRTC library for Unity and easy-to-use drop-in framework demonstrates how you can stream your projects through your browser.

The power of WebRTC technologies lets you run Unity projects with high-quality rendering through your browser. The framework can be used in runtime or in the Editor, so it is useful for a variety of purposes, like running a car configurator made with HDRP or viewing an architectural model – projects that use high-end graphics.

WebRTC bridges the gap between browsers and real-time rendering

Developed by Google in 2011, WebRTC is open-source software that enables real-time peer-to-peer communication between browsers and mobile platforms. Any device can use Unity’s open-source framework for render streaming, so long as it’s equipped with the latest version of a browser that supports WebRTC. This includes all major browsers for iPad, iPhone, and Android.

WebRTC can be paired with Unity thanks to our app based on the Apache 2.0 license, which is publicly available through Github. This library is also available as a Preview release through Package Manager, to make it even easier to add it to your project.

Render Streaming with the WebRTC + Unity drop-in framework 

We’ve used the library to develop a render streaming framework that allows you to run Unity applications through your browser.

After adding the Render Streaming package to your project, you can control your project in real-time from everyday browsers like Google Chrome and Safari, both on desktop and mobile devices.

The package is available to add to your project through the Package Manager today. The source code is available through this Github repository.

User input from the browser

The Render Streaming package instantly sends inputs from the browser to the Unity application. This includes keyboard input, mouse and touchpad input, and HTML button events. All you have to do is set up the input processing, just as you would for a regular Unity project, and the framework will pass the input to the new Input System using WebRTC’s DataChannel API. The result from browser inputs is the same quality of developer experience that you would get from working directly in Unity.

Simulcasting to multiple devices

With the Render Streaming package, you can broadcast video to multiple devices simultaneously. The maximum number of devices depends on the specs of the broadcasting machine and video quality – an average machine under normal circumstances can broadcast to about four devices at once.

One important consideration when using the Render Streaming package is the network environment. WebRTC handles video streaming, so a stable network is essential to maintaining video quality.

It is also important to remember that each additional device increases the burden on the broadcasting machine. It’s possible to create an intranet system to stream with the Render Streaming package, but setting up an internet-based broadcasting service requires a substantially more complicated system.

In general, if the goal is to broadcast to more than ten devices, we recommend incorporating an SFU decentralized server into the system structure along with a separate STUN/TURN server for WebRTC.

Video hardware encoding

To provide high-fidelity graphics and a solid streaming frame rate for high-quality user experience, we had to tackle two problems: performance and latency.

To reduce latency, the Render Streaming framework broadcasts applications to the browser using the NVIDIA Video Codec SDK to perform GPU hardware encoding on the frame buffer.

This means that to use the framework you currently need a computer with an NVIDIA GPU. Support for other GPUs is planned for future updates.

What’s the support like and how do I get started?

The WebRTC library is based on the Apache 2.0 license and managed as a community-supported technology. We encourage you to get involved in the continuing development of this technology. Feel free to fork the repository or expand any feature you like.

To get started, take a look at the tutorial document (English, Japanese) and consult the FAQ in the documentation for any additional questions. There is also a forum for WebRTC and Render Streaming, and we would love to get your feedback.

We’re excited to see what kind of amazing projects you’ll put together with the power of WebRTC and Unity.

18 replies on “Stream high-quality real-time graphics through your browser with our new WebRTC framework”

I want to stream to a texture on the remote unity peer instead of the browser. Does anyone know how to set this up?

Does it support multiple, different output ? Let say I want to map one camera to a port and a second camera on another port ?

Excellent addition to Unity’s tech line up. Yes, it’s nvidia and windows, but this is no problem for all business customers, visualisation, film etc. Hardware and OS is irrelevant to them.

As for game streaming like Stadia and more, well that’s a future-thing since this is the first release of this open-source effort. I guess we will even see the Unity editor streamed one day, potentially :D

Windows only??????
are you kidding?
why you do this?
and Nvidia only lol
since MS support in Unity3d we get a ton of those crap that runs only on Windows … are you kidding???
go and figure out…
very disappointing to see this happen more and more…
I’m more happy with UE @ moment… better performance on low machines than Unity!
Unity is just always behind the competitors… and full of bugs .. more and more…
the last two release are unusable on Mac… 2019.2.5F1 and 2019.2.4F1….
simple things like Slider is broken… where are the QA???
i don’t report bug anymore… do not get paid for !
and all the bug’s i’ve found and documented that got fixed after several years… :-(
for what??? no thanks nothing in return…
i really have given up on Unity3d … look in the forums and ask a question…
maybe maybe you’r get a answer… maybe but never from Unity stuff like in the old day’s where support was important!
Now it’s just making money and shareholders value what is interesting…
i’m a user and supporter from first release on Mac

Lol Mac first because you have a Mac?
It is always best to start developing for platforms that are used the most and then develop further if there is a demand for it. You can reach the most customers and Nvidia + Windows are just more common than Mac’s and AMD’s.
As an old Mac user I was glad I made the switch to Windows when VR development started becoming big and Unity helps me create those and other projects with ease. Back in the day it was impossible to run anything VR on a Mac.
If Unity is so bad, why use it and come here to complain? You are free to go wherever you want to go.
On topic: This new development looks like a really nice step up from WebGL and could be a game changer for online rendering.

> Lol Mac first because you have a Mac?

I’m not OP but OP probably wrote “i’m a user and supporter from first release on Mac” because until version 2.5, the Unity editor only ran on the Mac. I bought a Mac back then, a little after Unity 2.0 had been release, so I could use this game engine. Like you, I moved (back) to Windows for VR development – but I do remember the days when the Unity editor was available on Mac only, and those were really good days (you could do builds for Windows even back then, just no authoring on Windows).

That said, I think that for game development today, it’s a good thing to be able to test on all the platforms, with macOS admittedly being the least important except for doing iOS builds, maybe.

About Streaming: While in general not a fan of game streaming, I think this could actually be quite useful for local multiplayer, if it can render to different devices like to different screens, and if input is also handled appropriately (it seems from the description that this might be the case). Definitely something I’ll look into.

I hope you do go elsewhere for your game engine needs, so I never again have to lay eyes on your textual diarrhea of a post.

Lol behind the competition ? :D Optimized for smartphones development like no other. They started mainly on smartphones and for that, they become super large… So no competition here. More like UE has now competition with Unity.

Windows only…. are you kidding????
and Nvidia Card req. lol…
so who can use this????
where are the Mac user @ Unity3d ???
it was all better before Windows support :-(

User needs a WebRTC compatible mobile browser …. Safari, Firefox, or create a Cordova Webview Application with WebRTC enabled

Comments are closed.