Last update:2026-08-20 11:31:51
This guide explains how to configure, automate, control, and monitor live stream recordings on Media Acceleration Live Broadcast by using the Recording API.
The recording workflow has four parts:
Templates are the foundation. Both recording rules and on-demand recordings require a templateId, so create at least one template before using those APIs.
All recording APIs share a rate limit of 300 requests per 5 minutes per user. Design retries and polling intervals so your integration stays within this limit.
templateId.StartRealTimeRecord for an on-demand recording.persistentId.ListRecordings to find recording tasks within a time range.GetRecordingTaskDetail with a persistentId to check status and retrieve file information.StopRealTimeRecord to end an active recording before the stream ends naturally.A recording parameter template controls where and how recordings are stored. It can define the Object Storage bucket and management endpoint, file path, file format, segmentation behavior, retention period, audio and video handling, timeout behavior, and callback URL.
| API | Use it to |
|---|---|
AddRecordingParameterTemplate |
Create a template. Required settings include region, templateName, mgrUrl, recordParams, bucketName, fops, and fileFormat. |
QueryRecordingParameterTemplate |
List all templates or retrieve one template by templateId. |
ModifyRecordingParameterTemplate |
Update an existing template. Omitted fields retain their current values. |
DeleteRecordingParameterTemplate |
Delete a template by templateId. |
When modifying a template:
recordParams, the supplied list replaces the entire existing storage and format configuration list.notifyUrl to an empty string to remove the callback configuration. Omit it to keep the current value.ak, you must also provide its matching sk. You can omit both to use the current account’s credentials.Important: You cannot delete a template while it is associated with an active recording rule. Remove the template from all rules before deleting it.
A recording rule associates a templateId with live streams so recording can start automatically when a matching stream goes live.
Every new rule requires a Delivery Domain in pullDomain. You can narrow the match with these optional fields:
domain: Ingest DomainappName: Application NamestreamName: Stream NamestreamParams: stream-name suffix, such as _720P, for a transcoded streamThe system uses the longest, most specific match. For example, a rule for push.example.com/live/stream1 takes precedence over a rule for push.example.com/live, which takes precedence over a rule for push.example.com.
| API | Use it to |
|---|---|
AddRecordingRules |
Create a rule and associate it with a template. |
QueryRecordingRule |
List rules or filter them by ruleId, templateId, Ingest Domain, Delivery Domain, Application Name, or Stream Name. |
ModifyRecordingRules |
Update a rule’s template, match scope, Delivery Domain, stream suffix, or enabled state. |
DeleteRecordingRules |
Delete a rule by ruleId. |
Important: A rule cannot be deleted while it is active or executing a recording. Delete it only after it is no longer in either state.
Use the real-time control APIs when you need to record active streams immediately without relying on an automatic rule.
StartRealTimeRecord with a templateId and up to five stream delivery URLs in urlList.persistentId.persistentId. Use the relevant ID to query or stop that recording task.StopRealTimeRecord to terminate it earlier.| API | Use it to |
|---|---|
StartRealTimeRecord |
Start on-demand recording for up to five active stream delivery URLs. |
StopRealTimeRecord |
Stop one active recording task by placing its persistentId in the request path. |
Use the task query APIs to find recording tasks, monitor their progress, diagnose failures, and obtain information about generated recording files.
| API | Use it to |
|---|---|
ListRecordingTasks |
List recording tasks submitted within a specified time range and obtain their persistentId values. |
GetRecordingTaskDetail |
Retrieve the status and generated file information for one task by persistentId. |