Live Stream From Your Browser to the World With WebRTC (Update)September 15, 2022
If you need to stream to small-scale audiences with the lowest latency possible, this Wowza Video tutorial makes it easy. Our simple Web Real-Time Communications (WebRTC) workflow detailed in the video above is suitable for up to 300 viewers and can be done directly from your browser. And for those of you with greater volume, we also offer Real-Time Streaming at Scale for broadcasting to a million viewers.
Follow along to learn how to capture a live video and distribute it to audiences in just a few clicks — with 500-millisecond latency to boot.
Full Video Transcript:Justin Miller:
If you’re looking to stream with the lowest latency possible, you need to be thinking about WebRTC, which has around a 500 millisecond latency. WebRTC does have a few unique constraints, the first being it’s designed to encode within a browser and the second is that it’s not made for streaming to a large scale audience, limited to around 300 viewers. Now, there are a few workarounds to these issues, one of them being our Real-Time Streaming at Scale feature here at Wowza, which can stream to a million viewers. If you’re interested in that, please do contact firstname.lastname@example.org for a demo. However, in this video I’ll show you exactly what can be done with WebRTC using Wowza Video.
Now to get started, you need to Add Live Stream, name this stream appropriately, and then choose a location closest to where you’re broadcasting from. Next, you’ll need to choose the Web Browser (WebRTC) option as your encoder. While most other settings can be left as default, you may want to prioritize latency and change the aspect ratio. While these have nothing to do with WebRTC ingest egress, they do allow for an alternate HLS egress viewing option that will both prioritize latency and will create the correct renditions for adaptive bitrate streaming based on your aspect ratio.
Now we can bypass everything else and go straight to Finish. With the WebRTC stream created, we can do a quick Reload to ensure all the options have been generated. While as the video provides a
WebRTC published and playback page to get you up and running quickly, we also provide these source connection information for you to use with your own WebRTC pages. As I mentioned, there is also that HLS option allowing for millions of viewers, albeit with more latency. For this, we also provide a hosted page for viewing, player embed code, and the HLS playback URL for use within your own player.
Okay, so let’s get everything up and running. This usually takes a few seconds to even a minute to get going, but while we’re waiting, we can go to the WebRTC Publish Page. Now on this page, all the streaming settings have already been entered, but you can check for yourself. Beyond a webcam and a microphone, this page also allows virtual camera options like with OBS Studio. Just be sure you first go into OBS Studio and turn it on. Audio will require some different configurations. Generally, you’ll need to install what might be considered virtual audio cables on your system such as Soundflower and set them as you’re Monitoring Device. You’ll want to be sure your audio sources are being monitored and then you can select Soundflower as your WebRTC audio.
Once we’re ready to go, click Publish. Now we can open up the WebRTC Playback Page. We’ll hit Play and we can see here if we want the video in near real time. Of course, you may have to look at both the publish and preview page at the same time to verify this. While we’re at it, let’s compare the HLS stream by using the default player on our hosted page. Looking here, we can see that we’re nearly 10-seconds behind, however millions can view this stream as opposed to the 300 that can only watch the WebRTC stream.
Also, consider the fact that not all players are equal. You can always take the HLS playback URL and try it in a different player like Flowplayer. Here in Flowplayer. I’m getting around a six-second latency. While not great for immediate interactivity, it does help when talking to a large audience.
Also, you do have the option of sending your output to other Stream Targets. Simply Add Target here to Facebook, LinkedIn, or custom targets like YouTube. Once they’re created, you can go to Transcoders, select your WebRTC live stream, and then under Outputs and Targets, go to the highest resolution output and Add a Stream Target. You can manually enter them here or use the existing stream target options to add the ones you may have just created. These streams will have a similar latency to your HLS playback.
And that’s it when it comes to using WebRTC to stream. Please keep in mind you can also stream using SRT or RTMP to Wowza Video and then egress using WebRTC. This does increase latency by one or two seconds, and it can also be done with our Real-Time Streaming at Scale offering. Only that will let you stream to up to a million viewers using WebRTC. Again, please do contact email@example.com if you’re interested, and well thanks for watching and happy streaming.
Start Streaming in SecondsFree Trial
Check out our documentation to learn more about connecting a WebRTC stream to Wowza Video.