Live Recording

Last update:2026-04-15 18:20:37

This guide covers how to manage, automate, and control live stream recordings on Media Acceleration Live Broadcast using the Recording API.

The recording system is built around three layers:

  1. Templates — Define how to record: output format, storage destination, file segmentation, and callback settings.
  2. Rules — Define when to record: bind a template to specific streams so recording starts automatically.
  3. Real-Time Controls — Record on demand: manually start or stop a recording session for any active stream.

Templates are the foundation. Both Rules and Real-Time Controls reference a template by its templateId, so you must create at least one template before using the other APIs.

All recording APIs share a rate limit of 300 requests per 5 minutes per user. Plan your integration accordingly to avoid throttled requests.

Create Recording Templates (Template APIs)

A Recording Parameter Template tells the system how a recording should behave: where to store the output, how to name the files, when to segment, and where to send callback notifications.

Every recording — whether automated or manually triggered — requires a templateId, so templates are always the first thing you create.

API Name What It Does
AddRecordingParameterTemplate Creates a new recording template. You specify the storage destination (Object Storage bucket name, management URL, AccessKey/SecretKey), file path naming conventions, callback notification URLs, output format, and automatic file segmentation limits (by file size or time interval).
QueryRecordingParameterTemplate Retrieves a list of your existing templates, or the details of a specific template by its templateId.
ModifyRecordingParameterTemplate Updates the configuration of an existing template.
DeleteRecordingParameterTemplate Deletes an existing template.

Warning: You cannot delete a template that is currently associated with one or more recording rules. Disassociate the template from all rules before deleting it.

Set Up Automated Recording Rules (Rule APIs)

Once you have a template, you can automate recordings by creating Recording Rules. A rule binds a templateId to one or more live streams so that recording starts automatically whenever those streams go live.

You can target streams at three levels of specificity:

  • Delivery Domain — Records all streams under a domain.
  • Application Name — Records all streams under a specific application path.
  • Stream Name — Records a single, specific stream.

The system applies rules using the longest match principle: a rule targeting a specific stream name takes precedence over a broader domain-level rule. This lets you set wide defaults and override behavior for individual streams when needed.

API Name What It Does
AddRecordingRules Creates a rule that associates a templateId with live streams. You can scope the rule by Delivery Domain, Application Name, or Stream Name.
QueryRecordingRule Retrieves a list of existing rules. You can filter results by ruleId, templateId, domain, or stream name.
ModifyRecordingRules Updates the settings of an existing recording rule.
DeleteRecordingRules Deletes a recording rule.

Warning: You cannot delete a rule that is currently active or executing a recording. Wait for the recording to complete or stop it before deleting the rule.

Trigger On-Demand Recordings (Real-Time Control APIs)

When you need to record a live stream immediately — outside of any automated rule — use the Real-Time Control APIs to start and stop recording sessions manually.

How the workflow connects:

  1. Call StartRealTimeRecord with a templateId and up to 5 stream delivery URLs.
  2. The API returns a persistentId, which uniquely identifies that recording task.
  3. The recording continues until the stream ends naturally or you call StopRealTimeRecord with the same persistentId.

Always store the persistentId returned by the Start API. It is the only way to stop a specific recording session before the stream ends.

API Name What It Does
StartRealTimeRecord Triggers an immediate recording for active live streams. Requires a templateId and a list of up to 5 stream delivery URLs. Returns a persistentId that uniquely identifies the recording task.
StopRealTimeRecord Terminates an active, manually started recording task. Requires the persistentId (returned by StartRealTimeRecord) in the request path.
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!