Live streaming with Daily
Daily live streaming lets you broadcast a real-time, multi-participant video call to the streaming platform of your choice.
Live streaming sends RTMP streams, real-time data like call participants' video and audio, to a specific location over the internet where interested people can tune into the broadcast.
Webinars, conference panels, classes, concerts, all hands meetings at large companies, and many other live events are all good candidates for live streaming.
This guide covers:
- Key live streaming terms
- How a live stream works at a high level
- Daily live streaming
These definitions reflect how we use the key terms in this guide, and how we use them at Daily. We know folks often have opinions when it comes to this kind of lexicon, though, so consider this our caveat!
An encoder is a piece of software (or potentially hardware) that encodes, meaning compresses, the RTMP stream. Daily is an encoder.
HLS, or HTTP live streaming, is an HTTP-based adaptive bitrate streaming communications protocol developed by Apple Inc.
- A person with live streaming permissions joins a video call.
- That person starts a live stream.
- The encoder encodes an RTMP stream.
- The encoder starts to send the RTMP stream to the transcoder.
- The transcoder begins transcoding the RTMP stream into an HLS stream.
- Viewers around the world watch the stream live.*
*Live in this case means a delay of 3-20 seconds, depending on the transcoder.
Daily manages audio, video, and screen share streams for each participant on a call for up to 1000 participants. Daily live streaming encodes the collective call stream to a transcoder of your choice, and provides options to customize the stream layout. No external dependencies or multimedia streaming libraries are required.
By default, Daily live streaming outputs video at 1920x1080, 20 fps encoded as H.264 at 5 Mbps. The currently set maximum is 3840x2160 (4K UHD), but please reach out if you have other requirements.
Daily live streaming outputs audio encoded as AAC at 96 Kbps. Contact us if you have additional needs.
All live streams must occur over an SFU network connection.
A paid Daily account, a Daily room, an
"owner" meeting token for the room, an account with a transcoding provider, and an
rtmpUrl value are all needed to live stream.
1. Paid Daily account
Explore plan options on our pricing page.
2. Daily room
"owner" meeting token for the room
Only a meeting
"owner" can start a live stream. Use the Daily
/meeting-tokens endpoint to create a meeting token that identifies an
"owner" for the room:
4. An account with a transcoder to set up a destination for the stream
Some popular transcoders include Amazon IVS, Mux, YouTube Live, LivePeer, Azure, and Cloudflare. These are not the only options, but they're the ones we most frequently hear about. Please reference each provider's site for individual pricing and documentation details.
rtmpUrl value, made from the transcoder's ingest URL and stream key
A transcoder's ingest URL and stream key are typically available in the account dashboard. Combine the two into an
rtmpUrl value. The
rtmpUrl will be passed to the Daily
startLiveStreaming() method, and tell Daily where to send the stream.
rtmpUrl will vary depending on the provider. For example, some ingest URLs specify a string as a part or multiple parts of the domain. In the table below, those strings are represented as
Azure does not provide a stream key. If you're using Azure and Daily, please use an arbitrary stream key (like the
If you're using a transcoder not listed here, a generic template is:
Contact us if you run into any trouble.
1. Initialize a Daily call
2. Pass an
"owner" meeting token to the call on
Make sure the application knows when an owner has joined the call. Only an owner can start the live stream.
Connect this function to a UI element like a button.
stopLiveStreaming() to stop the live stream
Wire this function to a UI element like button.
The Daily API fires events corresponding to things that happen on a call. Those events can be responded to with event listeners.
Current live streaming related events include:
This snippet, for example, displays a console message when the live stream starts:
The event object describes the action:
Check out our live streaming events documentation for more details on each event.
The available configuration properties currently include:
width: Controls the resolution of the stream. This can only be set once via
backgroundColor: Specifies the background color of the stream, formatted as
#aarrggbbstring. This can only be set once via
layout: an object specifying the way participants’ videos are laid out in the stream. A
presetkey with one of the following values must be provided:
"default": This is the default grid layout, which renders participants in a grid, or in a single column vertical grid to the right, if a screen share is enabled. Optionally, a
max_cam_streamsinteger key can be provided to specify how many cameras to include in the grid. The default value is
9, which is also the maximum number of cameras in a grid. The maximum may be increased at a later date.
"single-participant": Use this layout to stream only a single participant's audio and video. The selected participant’s session ID must be specified via a
"active-participant": This layout focuses on the current speaker, and places up to 9 other cameras to the right in a single column vertical grid in the order in which they last spoke.
"portrait": Allows for mobile-friendly layouts. The video will be forced into portrait mode, where up to two participants will be shown. An additional variant key may be specified. Valid values are
"vertical"for a vertical grid layout (the default), and
"inset"for having one participant's video take up the entire screen and the other inset in a smaller rectangle. Participants' videos are scaled and cropped to fit the entire available space. Participants with the
is_ownerflag are shown lower in the grid (vertical variant), or full screen (inset variant).
"portrait" layout with
"portrait" layout with
"custom": Allows for a custom layout, including text overlay, image overlay, and more. This option provides access to Daily's Video Component System, which allows you to pass
session_assetsto customize the appearance of your recording. It is available for live streaming and
"cloud"recordings. A full list of available parameters is available in the reference docs. You can also test available options with the VCS Simulator.
"custom" layout with a text overlay: