Live streaming with Azure Media Services v3
Azure Media Services enables you to deliver live events to your customers on the Azure cloud. To stream your live events with Media Services, you need the following:
A camera that is used to capture the live event.
For setup ideas, check out Simple and portable event video gear setup.
If you do not have access to a camera, tools such as Telestream Wirecast can be used generate a live feed from a video file.
A live video encoder that converts signals from a camera (or another device, like a laptop) into a contribution feed that is sent to Media Services. The contribution feed can include signals related to advertising, such as SCTE-35 markers.
For a list of recommended live streaming encoders, see live streaming encoders. Also, check out this blog: Live streaming production with OBS.
Components in Media Services, which enable you to ingest, preview, package, record, encrypt, and broadcast the live event to your customers, or to a CDN for further distribution.
This article gives an overview and guidance of live streaming with Media Services and links to other relevant articles.
With Media Services, you can take advantage of Dynamic Packaging, which allows you to preview and broadcast your live streams in MPEG DASH, HLS, and Smooth Streaming formats from the contribution feed that is being sent to the service. Your viewers can play back the live stream with any HLS, DASH, or Smooth Streaming compatible players. You can use Azure Media Player in your web or mobile applications to deliver your stream in any of these protocols.
Dynamic encryption enables you to dynamically encrypt your live or on-demand content with AES-128 or any of the three major digital rights management (DRM) systems: Microsoft PlayReady, Google Widevine, and Apple FairPlay. Media Services also provides a service for delivering AES keys and DRM (PlayReady, Widevine, and FairPlay) licenses to authorized clients. For more information, see Dynamic encryption.
Dynamic filtering is used to control the number of tracks, formats, bitrates, and presentation time windows that are sent out to the players. For more information, see filters and dynamic manifests.
Live Event types
A Live Event can be one of two types: pass-through and live encoding. For details about live streaming in Media Services v3, see Live Events and Live Outputs.
When using the pass-through Live Event, you rely on your on-premises live encoder to generate a multiple bitrate video stream and send that as the contribution feed to the Live Event (using RTMP or fragmented-MP4 protocol). The Live Event then carries through the incoming video streams without any further processing. Such a pass-through Live Event is optimized for long-running live events or 24x365 linear live streaming.
When using live encoding with Media Services, you would configure your on-premises live encoder to send a single bitrate video as the contribution feed to the Live Event (using RTMP or Fragmented-Mp4 protocol). The Live Event encodes that incoming single bitrate stream to a multiple bitrate video stream, makes it available for delivery to play back devices via protocols like MPEG-DASH, HLS, and Smooth Streaming.
Live streaming workflow
To understand the live streaming workflow in Media Services v3, you have to first review and understand the following concepts:
- In your Media Services account, make sure the Streaming Endpoint (Origin) is running.
- Create a Live Event.
When creating the event, you can specify to autostart it. Alternatively, you can start the event when you are ready to start streaming.
When autostart is set to true, the Live Event will be started right after creation. The billing starts as soon as the Live Event starts running. You must explicitly call Stop on the Live Event resource to halt further billing. For more information, see Live Event states and billing.
- Get the ingest URL(s) and configure your on-premises encoder to use the URL to send the contribution feed.
See recommended live encoders.
- Get the preview URL and use it to verify that the input from the encoder is actually being received.
- Create a new Asset object.
- Create a Live Output and use the asset name that you created.
The Live Output will archive the stream into the Asset.
- Create a Streaming Locator with the built-in Streaming Policy types
- List the paths on the Streaming Locator to get back the URLs to use (these are deterministic).
- Get the hostname for the Streaming Endpoint (Origin) you wish to stream from.
- Combine the URL from step 8 with the hostname in step 9 to get the full URL.
- If you wish to stop making your Live Event viewable, you need to stop streaming the event and delete the Streaming Locator.
Other important articles
- Recommended live encoders
- Using a cloud DVR
- Live Event types feature comparison
- States and billing
Ask questions, give feedback, get updates
Check out the Azure Media Services community article to see different ways you can ask questions, give feedback, and get updates about Media Services.
Send feedback about: