Creating a Recording Template
Live allows you to record a livestream and store the recording in OBS, where you can download and share the recording.
Figure 1 shows the process of recording and storing a live video in OBS.
- (Optional) Create an OBS bucket for storing recordings. If you already have one, go to 2.
The created OBS bucket must be in the same region as Live.
- Authorize access to the OBS bucket so that the system can save the recordings in the OBS bucket.
- Authorizing access to an OBS bucket is allowed only under a Huawei Cloud account, but not allowed for IAM users.
- The OBS bucket that Live is authorized to access must be in the same region as Live.
- If you want to cancel the authorization of access to a bucket, check whether there are recordings or screenshots in the bucket. If there are, the recordings or screenshots will be removed from the bucket after the authorization is canceled.
- Configure a recording template. The recording template in which AppName and StreamName are the same as those in the ingest URL takes effect, and recordings are stored in OBS based on template settings. You can set a callback address to get notifications about the recording status.
- Push a stream through an ingest URL and record the livestream based on a configured recording template. For details about how to create an ingest URL, see Assembling an Ingest URL.
- Manage recordings. You can view basic information about recordings on the Live console, and manage recordings, such as preview, sharing, and deletion, on the OBS console.
The resolution of recordings is the same as that of the pushed streams.
Notes
- This function is unavailable in AP-Bangkok.
- Recording rules can be configured at domain name, application, and stream levels. Rules at the stream level take effect first. Rules at the same level must have the same recording type.
- Recordings cannot be deleted from Live because Live does not store recordings. Live logs recording events and store them for 30 days. You can manually delete recordings from OBS or configure OBS lifecycle management rules to set a retention period and policy for recordings.
- If stream push is interrupted due to network jitter during live recording, recording stops. When stream push resumes, recording restarts accordingly.
- Recording starts when stream push starts and stops until stream push ends. Recording cannot be stopped or started during stream push. If the recording template is deleted during stream push, recording continues until stream push ends.
- Ensure that OBS is not suspended due to arrears. Otherwise, recording will fail. You are advised to buy an OBS package.
- Only input livestreams can be recorded. Transcoded livestreams cannot be recorded.
Prerequisites
- You have added an ingest domain name.
- You have configured CNAME records at your domain names' DNS provider.
- Recordings are stored in OBS. You must enable OBS before storing recordings in OBS.
Pricing Notes
- Live recording fees are charged by Live.
- Live recordings are stored in OBS. Therefore, OBS charges you for the storage. See OBS Pricing Details.
Step 1: (Optional) Create an OBS Bucket
If you have not created an OBS bucket, create one. If you already have one, go to Step 2: Authorize Access to the OBS Bucket.
Step 2: Authorize Access to the OBS Bucket
Authorize Live to store recordings in OBS buckets.
After access to the OBS bucket is authorized, Live can access the OBS bucket. Ensure that the bucket processes only workloads related to Live. Do not store confidential files in the bucket.
- Log in to the Live console.
- In the navigation pane, choose OBS Authorization.
- Under the Live tab, click Authorize in the Operation column of the desired OBS bucket.
Step 3: Configure a Recording Template
If you want to record a livestream for replay, configure a recording template. The recording template in which App Name and Stream Name are the same as those in the ingest URL takes effect.
- Log in to the Live console.
- In the navigation pane, choose Domains.
- Click Manage in the Operation column of the desired ingest domain name.
- In the navigation pane, choose Templates > Recording (New).
- Click Create Recording Template.
- Configure recording parameters. Table 1 describes the parameters.
Figure 2 Configuring recording parameters
Table 1 Recording parameters Parameter
Description
Recording Type
- Automatic: The recording automatically starts when livestreams that meet the configured recording template are pushed.
- Manual: When livestreams that meet the configured recording template are pushed, you can call the API for Submitting a Recording Command to start or stop recording livestreams.
NOTE:- The recording type cannot be changed once configured.
- Only when livestreams are pushed, can the API for submitting a recording command be called.
- Manual recording supports only recording start and stop for a specific stream. Even if the recording rule is at the domain name level, the stream name must be specified when you deliver the recording start and stop commands.
- To manually stop recording, you can set Maximum Stream Pause Length when configuring the recording rule, so that recording will stop when the stream has been paused beyond the time indicated by Maximum Stream Pause Length. You can also call an API to stop recording.
- After the command for stopping recording is manually delivered, it takes a period of time to clear resources for the recording task. If the command for starting recording is delivered again shortly after the stop command is delivered, a message indicating that the recording task is not complete may be returned.
App Name
Application name. The default value is live. You can customize the application name. Only letters, digits, underscores (_), and hyphens (-) are allowed. If this parameter is set to *, the recording template applies to all applications under the domain name.
Stream Name
Livestream name. If this parameter is set to *, the recording template applies to all livestreams with the same App Name.
Storage Location
Where recordings are stored
Storage Bucket
OBS bucket where recordings are stored
Storage Path
OBS path where recordings are stored
To change the path later, click Edit in the Operation column of the row containing the template in the recording template list.
Record As
Format of a recording. Live videos can be recorded in HLS, FLV, or MP4 format.
HLS
M3U8 File Naming: The storage path and file name prefix need to be specified.
Record/{publish_domain}/{app}/{record_type}/{record_format}/{stream}_{file_start_time}/{stream}_{file_start_time}
Parameter description:
- Record: Retain the default value.
- publish_domain: the ingest domain name added on the Live console
- app: application name, which defaults to live
- record_type: value of Recording Type on the current page
- record_format: value of Record As on the current page
- stream: livestream name
TS File Naming: The file name prefix needs to be specified.
{file_start_time_unix}_{file_end_time_unix}_{ts_sequence_number}
Recording Length: Its value ranges from 1 to 720 minutes. If a live video has been recorded for more than 12 hours, a new M3U8 file will be created based on the naming rule.
Options of Max Stream Pause Length:
- Generate a new file when a stream is paused
- Do not generate a new file when a stream is paused
- Other: If the interruption duration of a livestream exceeds the specified range, a new recording file is generated. The maximum value of Max Stream Pause Length is 300s.
FLV
File Naming: The storage path and file name prefix need to be specified.
Record/{publish_domain}/{app}/{record_type}/{record_format}/{stream}_{file_start_time}/{file_start_time}
Parameter description:
- Record: Retain the default value.
- publish_domain: the ingest domain name added on the Live console
- app: application name, which defaults to live
- record_type: value of Recording Type on the current page
- record_format: value of Record As on the current page
- stream: livestream name
Recording Length: Its value ranges from 1–360 minutes. If a live video has been recorded for more than six hours, a new file will be created based on the naming rule.
Options of Max Stream Pause Length:
- Generate a new file when a stream is paused
- Other: If the interruption duration of a livestream exceeds the specified range, a new recording file is generated.
MP4
File Naming: The storage path and file name prefix need to be specified.
Record/{publish_domain}/{app}/{record_type}/{record_format}/{stream}_{file_start_time}/{file_start_time}
Parameter description:
- Record: Retain the default value.
- publish_domain: the ingest domain name added on the Live console
- app: application name, which defaults to live
- record_type: value of Recording Type on the current page
- record_format: value of Record As on the current page
- stream: livestream name
Recording Length: Its value ranges from 1–360 minutes. If a live video has been recorded for more than six hours, a new file will be created based on the naming rule.
Options of Max Stream Pause Length:
- Generate a new file when a stream is paused
- Other: If the interruption duration of a livestream exceeds the specified range, a new recording file is generated.
If livestream push is normal, the time when HLS recordings are generated in the OBS bucket is related to the keyframe interval configured on the player. By default, the first recording is generated after three keyframe intervals (6 seconds). An FLV or MP4 recording is generated only after the recording ends.
The value of Max Stream Pause Length affects the triggering of the recording callback event RECORD_FILE_COMPLETE.
- Do not generate a new file when a stream is paused: When the recording duration reaches the configured recording length, a recording file is generated and the recording callback event is triggered.
- Generate a new file when a stream is paused: Every time a stream is interrupted, a new recording file is generated and the recording callback event is triggered.
- Other: Every time the stream interruption duration reaches the specified value, a new recording file is generated and the recording callback event is triggered. If the stream interruption duration does not reach the specified value and the recording duration reaches the configured recording length, a recording file is generated and the recording callback event is triggered.
- Click OK.
You can create multiple recording templates. The recording template in which App Name and Stream Name are the same as those in the ingest URL takes effect.
- Obtain an ingest URL to push streams.
The resolution and bitrate of the generated recordings are the same as those of the livestream.
You can manage recordings on the OBS console, such as preview, download, and share.
Modifying or Deleting a Recording Template
You can perform the following operations on your recording template:
- Editing a recording template
Click Edit in the Operation column of the row containing the target recording template in the template list to edit the template.
The recording type cannot be changed.
- Deleting a recording template
Click Delete in the Operation column of the row containing the target recording template in the template list to delete the template.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot