How to setup MAS for live streaming
To begin using MAS you will need to have an account. After your MAS account is setup, you can then begin to setup MAS for live streaming by following the tutorial below.
Which streaming protocols and publishing methods are supported?
- You can push an RTMP stream to MAS and the stream will be forwarded to all MAS edge servers before being streamed to your end users over RTMP. MAS can also optionally transcode your RTMP stream to HLS (Http Live Streaming) on the fly so that your end users have a choice between RTMP and HLS streams. This is helpful if you want your end users to be able to watch your live stream on mobile devices.
- MAS can pull an RTMP stream from your media server and the stream will be forwarded to all MAS edge servers before being streamed to your end users over RTMP. Note: Transcoding to HLS is not supported using this method. If you require HLS support please use method 1.
Create a new streaming configuration
This tutorial assumes that you have a media server (e.g. Wowza) capable of either pushing an RTMP stream to a URL or having MAS pull an RTMP stream from your media server.
Click on "Configurations" in the top menu and then click on the gold "Create a configuration" button. Follow these steps to complete the form:
- Select "Live Streaming (RTMP to RTMP/HLS)"
- Give your configuration a name using no spaces and a maximum of 8 characters.
- Select an Ingest Server - this is the MAS geographic node cluster that you want to publish your RTMP stream to. To reduce transfer delays, we recommend choosing the node cluster which is nearest to your media server. For example, if your media server resides on the US West Coast then select a MAS Ingest Server which is also located on the US West Coast.
- If you want MAS to pull a stream from your media server then check the "Use an existing RTMP/RTSP stream" checkbox and complete the configuration settings for your media server.
- Automatic HLS conversion - scroll down and you will see the HLS settings section. Check the "Enable HLS" box and add your HLS fragment size and window size settings
- HLS fragment size (seconds) - this is the duration in seconds of each HLS fragment. Note that client-side players will buffer the first 2-3 fragments before videos start playing. MAS recommends an HLS fragment size of 10 seconds.
- HLS window size (seconds) - this is the duration in seconds of the HLS sliding window, composed of multiple fragments. Sliding windows are used in client-side players when users scrub (fast forward or rewind) through a video. MAS recommends an HLS window size equivalent to 3 HLS fragments. ie. if you set fragment size to 5 then set window size to 30.
- If you want your streaming URLs for RTMP and HLS to use your own domain then you can specify your domain name or subdomain, and after creating the configuration you should create a CNAME record with your DNS provider which points to your MAS live streaming configuration's subdomain.
- If you have opted to use your own domain and you now want to use your own SSL certificate then you can upload your own SSL key and SSL certificate in the available form fields.
- Click the gold "Add New Configuration" button at the bottom of the dialog window to finish the setup of your configuration.
You can now publish your stream to MAS and it will be forwarded to all MAS edge servers, optionally transcoded to HLS, and then streamed to your end users. Click on "Publish URLs" in the left menu to find the RTMP URL to publish your stream to. Click on "Stream URLs" to find your RTMP and HLS streaming URLs.If you have any issues or questions with setting up MAS for live streaming please don't hestitate to contact our support team at firstname.lastname@example.org