Configuring a Recording Callback
You can configure an HTTP/HTTPS URL to receive recording status feedback. The system will send POST requests in JSON format to your server, so that you can know the recording status.
Prerequisites
Procedure
- Log in to the Live console.
- In the navigation pane, choose Domains.
- Click Settings in the row containing the target ingest domain name.
- In the navigation pane, choose Template Settings > Recording (New Version).
- Click Add Callback Configuration, as shown in Figure 1. Table 1 describes the callback parameters.
Table 1 Recording callback parameters Parameter
Description
Callback URL
The callback URL cannot contain message headers or parameters. Only the HTTP/HTTPS protocol is supported.
Callback Type
When callback messages are sent. The options are as follows:
- Recording file generation completed
- Recording started
- Create a new recording file
- End of recording
- Recording failed
For details about callback types, see Table 2.
Authentication Mode
The encrypted content in callback messages varies depending on the authentication methods.
- MD5: MD5(key + auth_timestamp)
- HMACSHA256: HMACSHA256(auth_timestamp + event_type + publish_domain + app + stream + download_url + play_url, key)
Authentication Key
Authentication key. You can customize a key. A key consists of 32 characters. Only letters and digits are allowed.
Modifying or Deleting a Recording Callback
You can perform the following operations on your recording callback:
- Editing a recording callback
Click Edit in the Operation column of the row containing the target recording callback in the callback list to edit the callback.
Figure 2 Editing a recording callback
- Deleting a recording callback
Click Delete in the Operation column of the row containing the target recording callback in the callback list to delete the callback.
Figure 3 Deleting a recording callback
Callback Example
Table 2 describes the fields in a callback message body.
{
"project_id" : "70b76xxxxxx34253880af501cdxxxxxx",
"job_id":"dc0a1773-0cef-xxxx-xxxx-9a38fdb095d2",
"event_type" : "RECORD_FILE_COMPLETE",
"publish_domain" : "push.example.com",
"app" : "live",
"stream" : "mystream",
"record_format" : "HLS",
"download_url" : "https://obs.cn-north-4.myhuaweicloud.com/live/record-xxxx-mystream-1589967495/record-push.example.com-live-mystream-1589967495.m3u8",
"asset_id" : "1a0d8e9bfaexxxxxxbe5021e62aa1e96",
"play_url" : "https://2-cn-north-4.cdn-vod.huaweicloud.com/asset/1a0d8e9bfae388cxxxxxx21e62aa1e96/55c634374750cexxxxxxc035a26ecfac.m3u8",
"file_size" : 3957964,
"record_duration" : 120,
"start_time" : "2020-03-08T14:10:25Z",
"end_time" : "2020-03-08T14:12:25Z",
"width" : 1280,
"height" : 720,
"obs_location" : "https://obs.cn-north-4.myhuaweicloud.com",
"obs_bucket" : "mybucket",
"obs_object" : "live/record-xxxx-mystream-1589967495/record-hwpublish.myun.tv-live-mystream-1589967495.m3u8"
"auth_sign" : "4f97f46759axxxxxx7ad21e9935dc175",
"auth_timestamp" : "1583676745"
}
|
Field |
Description |
|---|---|
|
project_id |
Project ID |
|
job_id |
Name of a file. This parameter is carried when the value of event_type is RECORD_NEW_FILE_START or RECORD_FILE_COMPLETE. |
|
event_type |
Message type. Possible values are:
|
|
publish_domain |
Ingest domain name |
|
app |
Application name |
|
stream |
Stream name |
|
record_format |
Recording format. The HLS, FLV, and MP4 formats are supported. |
|
download_url |
Address to download the recording. This parameter is used only when event_type is RECORD_FILE_COMPLETE.
NOTE:
The quality of video playback using the download address cannot be guaranteed. You can authorize VOD to host recordings stored in OBS when configuring a recording template, configure a recording callback, and set event_type in the callback to RECORD_FILE_COMPLETE. Then you can use the URL specified by play_url in callback messages for video playback. |
|
asset_id |
Media ID used on the VOD side after you authorize VOD to host the recordings in OBS when configuring a recording template. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
play_url |
Playback URL of the recording. This parameter is carried only when you have configured a recording template and authorized VOD to host the recordings in OBS and the value of event_type is RECORD_FILE_COMPLETE. |
|
file_size |
File size Unit: byte |
|
record_duration |
Duration of a recording Unit: second |
|
start_time |
Start time of a recording, which is, time when the first frame is received. The format is yyyy-mm-ddThh:mm:ssZ. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
end_time |
End time of a recording. The format is yyyy-mm-ddThh:mm:ssZ. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
width |
Width of a video recording. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
height |
Height of a recording. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
obs_location |
Region where the OBS bucket for storing the recording is located. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
obs_bucket |
OBS bucket where recordings are stored. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
obs_object |
OBS storage path. This parameter is used only when event_type is RECORD_FILE_COMPLETE. |
|
auth_sign |
Event notification signature.
|
|
auth_timestamp |
UNIX timestamp when the event notification signature expires. The value is a decimal Unix timestamp, that is, the number of seconds since 00:00:00 UTC/GMT on 1 January 1970. If the time specified by auth_timestamp has expired, the notification will become invalid to avoid network replay attacks. |
|
error_message |
Description about a failed recording. This parameter is used only when event_type is RECORD_FAILED. |
Last Article: Configuring a Recording Template
Next Article: Managing Recordings

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.