To facilitate playback of live recordings, ApsaraVideo Live allows you to record live streams and store the recorded videos in an Object Storage Service (OSS) bucket. You can play the recorded videos in OSS.

Prerequisites

An OSS bucket is created. For more information, see Configure OSS.
Note The OSS bucket must reside in the same region as the live center that you select when you add the domain. Cross-region recording is not supported.

Create a recording template

Notice You cannot store the recording of a live stream in both ApsaraVideo VOD and an OSS bucket.
  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Select the streaming domain that you want to configure and click Domain Settings.
    Configure the domain name
  4. Choose Templates > Recording Settings.
  5. On the OSS tab, click Add.
  6. Create a recording template.
    Recording template

    The following table describes the parameters that you can set to create a recording template.

    Parameter Description
    Application Name The name of the video application. The value of this parameter must be the same as the application name specified in the ingest URL. Otherwise, the configuration does not take effect. If you need to record live streams for all applications in your domain, enter an asterisk (*).
    Stream Name You can store the recording of a specific live stream in OSS by specifying the stream name. If you need to record all the streams under the application that the Application Name parameter specifies, enter an asterisk (*).
    Note The values of the Application Name and Stream Name parameters can be up to 255 characters in length and can contain letters, digits, hyphens (-), and underscores (_).
    Storage Format Valid values: flv, m3u8, and mp4.
    Notice Recordings in the FLV and MP4 formats are not supported in the China (Qingdao) region.
    Naming Conventions The default storage path of the recordings.
    • M3U8: record/{AppName}/{StreamName}/{EscapedStartTime}_{EscapedEndTime}
    • TS: record/{AppName}/{StreamName}/{UnixTimestamp}_{Sequence}
    • MP4: record/{AppName}/{StreamName}/{EscapedStartTime}_{EscapedEndTime}
    • FLV: record/{AppName}/{StreamName}/{EscapedStartTime}_{EscapedEndTime}

    Example:

    The value of the Application Name parameter is app, and the value of the Stream Name parameter is stream. Then, the storage path of the recordings in the M3U8 format is record/app/stream/{EscapedStartTime}_{EscapedEndTime}.

    Recording Duration Valid values: 15 to 360. Unit: minutes. The maximum recording duration is 6 hours. If the recording duration exceeds 6 hours, the system generates a new file based on the recording naming rule. By default, the TS segment length is 30s.
    Note The recording duration specifies the maximum length of a video-on-demand (VOD) file that is converted from the specified live stream.
    Storage Location The storage location.
    Note Buckets include standard buckets and media buckets. Standard buckets are OSS buckets and are used for storage. Media buckets are buckets that are customized for ApsaraVideo for Media Processing. Videos stored in media buckets can be transcoded by ApsaraVideo for Media Processing. The bucket type is not distinguished in the bucket list. If you need to convert videos to media files, you must remember the name of the media bucket that you use.
  7. Click OK.

Create a recording callback configuration

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Select the streaming domain that you want to configure and click Domain Settings.
    Configure the domain name
  4. Choose Templates > Recording Settings.
  5. Click the OSS tab and then the edit icon next to Callback URL:.
  6. In the Configure Callback URL dialog box, enter a callback URL.

Alternatively, you can call the AddLiveRecordNotifyConfig operation to create a recording callback configuration for a streaming domain. For more information, see AddLiveRecordNotifyConfig.

For more information about the callback methods and parameters, see Manage callbacks.

What to do next

View or manage recordings.