Streaming

Recording WebRTC Streams with Dolby.io

Pictured is a race car stream being recorded by Dolby.io streaming.
SUMMARY

Want to watch a live stream after it’s finished? In this guide we highlight how to record a WebRTC live stream with Dolby.io Streaming.


WebRTC allows for high-quality low latency live streams, engaging audiences all over the world in real-time.

But what about those that can’t join the live stream synchronously?

In this guide, we’ll explore how to enable recording for your Dolby.io WebRTC live stream and how you can retrieve these recordings for distribution on platforms such as YouTube and Facebook.

Enabling WebRTC Live Stream Recording 

To enable WebRTC stream recording your first need to navigate to the Dolby.io streaming dashboard and create a new token or edit an existing token. To create a new token, click the purple and white “create” icon on the top left of the Live broadcast - Publish tokens page, name your token, and click on the Recording Broadcast button from within the token editor. 

Pictured is the token creation interface with the Recording broadcast setting highlighted in red to remind users to enable it.
The token creation interface on the Dolby.io Dashboard.

Alternatively, if you have an existing token you want to enable recording for you can edit it in the Token details tab of the token.

Pictured is the token setting page with a red box highlighting the record setting to remind users to enable the record setting.
Once the token has been created you can still enable recording. Just click on the token to open the settings and from the settings (pictured above) you can edit the record value.

With recording enabled, any stream created with this token will automatically capture the stream and save it to the archive. It’s important to note that token properties such as recording can’t be updated during broadcast, requiring the stream to conclude before the changes take effect. 

If you are programmatically creating tokens with the Dolby.io Streaming REST API you can control whether the stream is recorded by setting the record flag to true.

const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({record: true})
};
 
fetch('https://api.millicast.com/api/publish_token', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Where Can I Find WebRTC Live Stream Recordings?

Once you have created a recording-enabled token you can begin streaming to your audience. Once the stream is finished, the recording will be processed and added to the archive. The archive can be found on your Dolby.io Streaming Dashboard and allows you to filter by tokentoken name or token creation date.

The recording archive page with some example recordings of the author testing out the Streaming Unity plugin.
Once a recording is finished it’ll be added to the Recordings Archive page for users to download or review as they see fit.

From the archive, we can download the recordings for syndication on platforms such as YouTube or Facebook.

In addition to the Dolby.io Streaming Dashboard, you can listread, and delete recordings programmatically with the Streaming REST API. For example, this API call lists 100 recordings associated with a particular token:

const options = {
  method: 'GET',
  headers: {accept: 'application/json', authorization: 'Bearer YOUR_API_KEY'}
};
 
fetch('https://api.millicast.com/api/record_files/list_by_token?token=YOUR_TOKEN&sortBy=RecordedOn&page=1&itemsOnPage=100&isDescending=true', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Are there Costs Associated with Recording?

Storing recordings on the Dolby.io servers does incur an additional storage fee. This fee depends on your plan and can be found on the pricing page. All video archive prices are billed as price per Gigabyte (GB) per month. On the Standard plan, Video Archiving is billed at $0.25 /GB, meaning that a 1 GB file stored on the Dolby.io servers for 6 days would incur a charge of $0.05.

Get Started Building with Dolby.io Streaming

Dolby.io WebRTC streams can be enjoyed in real-time or asynchronously without sacrificing quality or scale. If you are interested in learning more about Dolby.io streaming check out our guide for building a low latency live stream app or how you can set up OBS to broadcast WebRTC streams.

Feedback or Questions? Reach out to the team on TwitterLinkedIn, or via our support desk

Braden Riggs

Developer Advocate

Born and Raised in Australia and now Living in San Francisco, Braden joined the Developer Relations team in 2021 after graduating from UC San Diego with a degree in data science. Braden loves to create apps and content for the Dolby.io Blog, YouTube channel, and the samples GitHub. When not working you can find Braden surfing, hiking, or exploring San Francisco.

Get Started

Drive real-time interactions and engagement with sub-second latency

We are more than just a streaming solutions provider; we are a technology partner helping you build a streaming ecosystem that meets your goals. Get started for free and as you grow, we offer aggressive volume discounts protecting your margins.

Developer Resources

Explore learning paths and helpful resources as you begin development with Dolby.io.

Copy link
Powered by Social Snap