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
Call the AddLiveAppRecordConfig operation to configure a recording rule.
Ingest a live stream.
Call the RealTimeRecordCommand operation to start recording.
If you want to stop recording, call the RealTimeRecordCommand operation.
The following table describes the API operations used for manual recording.
API operation | Description |
Configures a recording rule. | |
Deletes a recording rule. | |
Queries all configured recording rules. | |
Manually starts or stops recording. |
Examples
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>
NoteSet the OnDemand parameter to 7, which specifies that ApsaraVideo Live does not automatically record an ingested live stream.
Ingest a live stream.
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>
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.