The HLS architecture at Daily

Configure HLS
HLS is configured via thestreaming_endpoints room property. Here is an example of creating an HLS live stream configuration named hls_s3:
name: the label that will be used indaily-jsto reference a specific configurationtype: eitherrtmporhlsfor an RTMP and HLS configurationrtmp_config: the RTMP configuration details (whentypeisrtmp)url: the RTMP url
hls_config: the HLS configuration details (whentypeishls)save_hls_recording:truewhen you want to save the output of the live stream once the stream is finished; otherwise,false. This can be used as a replacement for cloud recording.variants: specifies all the HLS variants to generate. Specified as array with following properties.width: output width.height: output height.fps: output FPS.bitrate: output bitrate in kilobits per second (kbps).iframe_only: whether this is iframe-only variant.
storage: the storage details whensave_hls_recordingis set totruebucket_name: the name of the S3 bucket where the HLS output will be storedbucket_region: the AWS region of the S3 bucket (this is an S3 bucket that you own)assume_role_arn: The Amazon Resource Name to assume in order to write to the S3 bucketpath: (deprecated, use path_template) the S3 key path prefix for where to store the output HLS. The final master.m3u8 path template is<bucket_name>/<path>/<mtgSessionId>/master.m3u8.path_template: define the template to derive the S3 key path prefix where HLS is stored.
streaming_endpoints, check out the [rooms configuration][http://localhost:3000/reference/rest-api/rooms/update-room#body-properties-streaming-endpoints].
Daily only supports sending HLS output to your AWS S3 bucket. There is no support for storing HLS video within the Daily infrastructure. Check out our guide on storing call recordings in a custom Amazon S3 bucket.
streaming_endpoints on your room:
The save_hls_recording parameter
HLS is a livestream, i.e. it is available for consumption soon after [startLiveStreaming()][/reference/daily-js/instance-methods/start-live-streaming] call. This livestream can also be saved for later viewing with save_hls_recording.
true: During the livestream, the m3u8 playlist is[EVENT type playlist]and segments are not deleted. At the end of streaming, the playlist is converted to[VOD type playlist].false: During the livestream, new segments are appended to the m3u8 playlist and old segments are deleted from the playlist (as well as from S3). This keeps only the most recent 5 segments in the playlist at any point of time.
Start an HLS stream
After configuringstreaming_endpoints, start the stream with startLiveStreaming():
hls_s3 refers to the name of the endpoint defined in streaming_endpoints.
If you need HLS and cloud recording, or HLS and RTMP, in the same session, use multiple instances with unique
instanceId values. HLS cannot share an instanceId with RTMP or cloud recording.Serve HLS to your audience
Daily writes HLS output to your S3 bucket. Serve it to viewers through a CDN (such as Amazon CloudFront) rather than directly from S3. This reduces security risk and ensures content is served from the closest edge location to each viewer. In order to reduce security risk, your S3 resources should implement a “[least privilege access][https://docs.aws.amazon.com/AmazonS3/latest/userguide/security-best-practices.html]” model. CDN setup is outside the scope of this guide. Daily has an example project that creates the AWS infrastructure to serve HLS through CloudFront.Limitations
Daily does not store HLS output Output is stored in one of your AWS S3 buckets. This allows you to have more control over your data and its storage and access. Daily supports 4 bitrates out-of-the-box| Width | Height | FPS | Bitrate (kbps) |
|---|---|---|---|
| 1920 | 1080 | 30 | 2500 |
| 1280 | 720 | 30 | 1500 |
| 640 | 360 | 24 | 700 |
| 320 | 180 | 24 | 200 |
streaming_endpoints configuration.
HLS configuration is only available as a room property
streaming_endpoints is a room property and cannot be set at the domain level.
There is a maximum of 20 streaming_endpoints
You can store up to 20 streaming_endpoints configuration objects per room.