All Products
Search
Document Center

ApsaraVideo Live:Manual recording

Last Updated:Jul 23, 2024

This topic describes the scenarios, procedure, examples, and usage notes of manual recording.

Scenarios

In addition to automatic recording, you can call an API operation to manually record a live stream. To do so, you can add a recording configuration and set the OnDemand parameter to 7. A value of 7 specifies that ApsaraVideo Live does not automatically record a live stream.

You can also call an API operation to manually stop recording a live stream.

Procedure

  1. Call the AddLiveAppRecordConfig operation to configure a recording rule.

  2. Ingest a live stream.

  3. Call the RealTimeRecordCommand operation to start recording.

  4. If you want to stop recording, call the RealTimeRecordCommand operation.

The following table describes the API operations used for manual recording.

API operation

Description

AddLiveAppRecordConfig

Configures a recording rule.

DeleteLiveAppRecordConfig

Deletes a recording rule.

DescribeLiveRecordConfig

Queries all configured recording rules.

RealTimeRecordCommand

Manually starts or stops recording.

Examples

  1. Call the AddLiveAppRecordConfig operation to configure a recording rule. In this example, ApsaraVideo Live does not automatically record the live stream named liveStream**** that belongs to the liveApp**** application under the example.com domain.

    /?AppName=liveApp****
    &DomainName=example.com
    &StreamName=liveStream****
    &OssBucket=liveBucket****
    &OssEndpoint=oss-cn-shanghai.aliyuncs.com
    &RecordFormat.1.Format=mp4
    &RecordFormat.1.OssObjectPrefix=****{StartTime}_{EndTime}
    &OnDemand=7
    &<Common request parameters>
    Note

    Set the OnDemand parameter to 7, which specifies that ApsaraVideo Live does not automatically record an ingested live stream.

  2. Ingest a live stream.

  3. Manually start recording.

    When the live stream example.com/liveApp****/liveStream**** is ingested, call the RealTimeRecordCommand operation to start recording.

    /?AppName=liveApp****
    &DomainName=example.com
    &StreamName=liveStream****
    &Command=start
    &<Common request parameters>
  4. Manually stop recording.

    When the live stream example.com/liveApp****/liveStream**** is being recorded, call the RealTimeRecordCommand operation to stop recording.

    /?AppName=liveApp****
    &DomainName=example.com
    &StreamName=liveStream****
    &Command=stop
    &<Common request parameters>

Usage notes

  • If the specified live stream is not being ingested, an error is returned when you call the RealTimeRecordCommand operation to manually start recording.

  • If a live stream is interrupted after you manually start recording it, the recording stops. In addition, if automatic recording is not configured for the live stream, ApsaraVideo Live does not automatically record the live stream after the live stream is resumed.

  • ApsaraVideo Live supports triggered stream pulling, which automatically triggers ApsaraVideo Live to pull live streams when the streaming URL with a specific domain name is used for playback. If no live streams are played, ApsaraVideo Live does not pull live streams from the origin server. In this case, automatic recording, on-demand recording, and manual recording are disabled.