Live stream recording FAQ

Updated at:

This topic answers frequently asked questions about the live stream recording feature of ApsaraVideo Live.

Configure recording

Which trigger methods do recording templates support, and how do I choose?

Live stream recording supports four trigger methods:

Trigger method

OnDemand value

Scenarios

Description

Automatic recording

0

All matching streams must be recorded.

Default method. Recording starts as soon as the stream is ingested.

Callback confirmation

1

Whether to record is decided dynamically based on business rules.

When a stream is ingested, the system sends an HTTP request to your preset on-demand callback URL for confirmation.

Parameter in the ingest URL

2

The ingest client controls whether to record.

The ingest URL carries the record_config parameter.

Manual recording

7

The recording is fully controlled by business logic.

Call the RealTimeRecordCommand operation to start or stop recording.

Notes:

  • If you use callback confirmation, you must first specify the on-demand callback URL in the event callback configuration. For more information, see How does the on-demand recording callback mechanism work? Why does on-demand recording not start?.

  • If you use the ingest URL parameter method, URL-encode the record_config parameter. Example: rtmp://push.example.com/live/stream1?record_config=%7B%22NeedRecord%22%3Atrue%7D

  • If you use manual recording, first create a recording template with the trigger method set to manual recording. After stream ingest starts, call the RealTimeRecordCommand operation to start recording.

Can a live stream be recorded to VOD and OSS at the same time?

No. You cannot configure two storage methods for the same live stream. Choose one based on your business requirements:

  • Record to VOD: suitable for post-production of recordings, such as editing, transcoding, and merging. Automatic merging is supported.

  • Record to OSS: suitable for long-term storage and management of recordings. The M3U8, FLV, MP4, and CMAF storage formats are supported.

    The following table compares the two storage methods.

Aspect

Record to VOD

Record to OSS

Storage location requirement

The ApsaraVideo VOD storage bucket must be in the same region as the live center of the streaming domain.

The OSS bucket must be in the same region and under the same account as the live center of the streaming domain. Cross-account or cross-region storage is not supported.

Merging of split files

Automatic merging when the stream ends

Index-based editing or the CreateLiveStreamRecordIndexFiles operation

Callback configuration

Video Upload Complete event callback in ApsaraVideo VOD

Recording callback URL in ApsaraVideo Live (Features > Event Callbacks)

Playback URL

GetPlayInfo operation of ApsaraVideo VOD

Direct OSS URL or presigned URL

Retrieving recordings

ApsaraVideo Live console, ApsaraVideo VOD console, or the GetVideoList or GetVideoInfo operation

ApsaraVideo Live console, OSS console, or the DescribeLiveStreamRecordIndexFiles operation

Deleting recordings

DeleteVideo operation of ApsaraVideo VOD

ApsaraVideo Live console, DeleteLiveStreamRecordIndexFiles operation, or OSS

The following sections describe these behaviors in detail.

"There is no bucket in the same region as the live domain in OSS" appears when I select OSS storage?

This message means that your OSS has no bucket in the region that matches the region of the live center of your streaming domain. Check the region of the live center of the streaming domain in the ApsaraVideo Live console (Domains), and then create a bucket in that region in the OSS console. For the complete storage requirements of each storage method, see Can a live stream be recorded to VOD and OSS at the same time?.

Why can't I select a transcoding template when I record a live stream to VOD?

To use a recording transcoding template, first create a transcoding template group in ApsaraVideo VOD, the video-on-demand service of Alibaba Cloud. The region of the transcoding template group must match the region of the live center of the current domain. For example, if the live center of the domain is in China (Shanghai), the transcoding template group must also be created in China (Shanghai).

For more information, see transcoding templates.

Why are some regions shown as unsupported when I record to VOD?

Some regions may not yet support recording to VOD. In this case, record to OSS instead, and then use ApsaraVideo Media Processing for subsequent operations such as transcoding.

How do I troubleshoot the 500 Internal Server Error returned by the UpdateLiveAppRecordConfig operation?

Check the following three areas:

Parameter validation

  • Make sure that the required parameters such as OssEndpoint, DomainName, and AppName are complete and correct.

  • If you use the M3U8 format, you must set the SliceOssObjectPrefix parameter.

Environment check

  • Verify network connectivity (live.aliyuncs.com and the OSS endpoint).

  • Verify that the system time is synchronized. The time skew must be less than 15 minutes.

  • Verify the permissions of the AccessKey. The AccessKey must have the live:UpdateLiveAppRecordConfig permission, and the source IP address of the call must be in the whitelist.

Configuration consistency

  • The AppName and StreamName in the request must exactly match those of the existing recording configuration. Otherwise, the update fails.

    After you address these items, call the UpdateLiveAppRecordConfig operation again to verify that the request succeeds. If the error persists, submit a ticket to contact Alibaba Cloud technical support.

Calling RealTimeRecordCommand for manual recording fails because no recording template is configured

Before you call the RealTimeRecordCommand operation for manual recording, you must create a recording template and set the trigger method to manual recording (OnDemand=7). The system needs the recording template to get parameters such as the storage configuration. For more information, see Which trigger methods do recording templates support, and how do I choose?.

A live stream I missed was not configured for recording. Can I recover the video content?

If no recording template was configured during the live stream, the live service does not save the stream data. The content cannot be recovered after the live stream ends. Configure the recording template before each live stream.

How do I record content in a stream pulling and relay scenario?

After you use stream pulling and relay to pull an external source and push it to the live service, the system treats it as a regular ingest. Configure a recording template for the target streaming domain of the stream pulling and relay task to record the relayed content.

Notes:

  • Make sure the stream pulling and relay task is running normally and transferring audio and video data.

  • The AppName and StreamName in the recording template must match the target stream information in the stream pulling and relay configuration.

File generation and segmentation

How long after a live stream ends can I view the recording? Can the recording be generated immediately?

Generation mechanism

A recording is not generated at the moment the stream is interrupted. After the stream is interrupted, the system waits for the stream interruption stitching duration (180 seconds by default). If stream ingest resumes within this period, the recorded content is automatically merged into the same file. If ingest does not resume before the timeout, the system determines that the live stream has ended and generates the recording.

You can adjust the stream interruption stitching duration from 15 to 21,600 seconds based on your business requirements. If the duration is too short, network fluctuations may generate a large number of fragment files. If the duration is too long, you must wait a long time after the live stream ends before the file becomes available.

Generate the recording immediately

To get the recording immediately after the live stream ends without waiting for the stream interruption stitching duration, set an event callback for stream ingest (see Event callbacks). When you receive the stream end notification, call the RealTimeRecordCommand operation to cancel the stitching wait:

realTimeRecordCommandRequest.setCommand("cancel_delay");

No recordings are generated after I configure a recording template?

Work through the following checks in order:

Check when the recording template was configured.

The recording template must be created and configured before stream ingest starts. A template created during ingest takes effect only for the next ingest.

Check the matching rules of the recording template.

Verify that the AppName and StreamName in the recording template match those in the ingest URL. The system applies an exact match first policy. The following table describes the matching logic.

Priority

DomainName

AppName

StreamName

1

Specified

Specified

Specified

2

Specified

Specified

*

3

Specified

*

*

Check the storage configuration.

Verify that the storage bucket meets the region and account requirements of your storage method. For more information, see Can a live stream be recorded to VOD and OSS at the same time?.

Check OSS write permissions.

To record to OSS, you must authorize the AliyunMTSDefaultRole role. If the permission was accidentally deleted, click Authorize cloud resource access to complete quick authorization.

Check the OSS bucket state.

If the OSS bucket was released due to overdue payments or disabled due to violations, recordings cannot be written. Go to the OSS console and check the bucket status.

Check that the ingest carries actual audio and video data.

If the ingest connection is normal but no valid audio or video frames are sent, the system does not trigger recording. Play the live stream to verify that it has video and audio.

Check the audio and video codec formats.

Live stream recording supports only the following codec formats:

  • Video codecs: H.264 (AVC), H.265 (HEVC), MPEG-4

  • Audio codecs: AAC, MP3

    If the live stream contains audio or video encoded in other formats, issues such as no recording generated, black screen, or no audio may occur.

After you address the preceding items, trigger a test recording and verify that a recording is generated. If no recording is generated after all checks pass, submit a ticket to contact Alibaba Cloud technical support.

Check whether the playback trigger is required for transcoded stream recording.

If only the transcoding stream is selected for the recording content, and the corresponding transcoding template is enabled to trigger transcoding, transcoding recording is started only when the audience plays the transcoding stream. If you want to start recording immediately after streaming, you can use any of the following methods:

  • Turn off trigger transcoding in the transcoding template. After closing, transcoding will be started as long as there is a push stream.

  • Select the source stream in the recording content of the recording template.

    Note

    Modifying the transcoding template will not affect the ongoing stream push. The stream push will take effect only after the stream is cut off.

What is the purpose of the recording epoch?

The recording epoch is the maximum duration of a single recording file. When the live stream lasts longer than the recording epoch, the system automatically splits the recording and generates a new file.

  • Default value: 180 minutes

  • Range: 15 to 360 minutes

    You can set the recording epoch when you configure a recording template in the ApsaraVideo Live console, or by calling the AddLiveRecordVodConfig operation (record to VOD) or the AddLiveAppRecordConfig operation (record to OSS).

Many short recordings are generated after the live stream ends?

Multiple short recordings are usually generated for the following reasons:

  • Frequent ingest interruptions: After an interruption lasts longer than the stream interruption stitching duration, the system generates an independent recording. Check the network stability of the ingest side.

  • Recording epoch set too short: When the live stream lasts longer than the recording epoch, the system automatically splits the recording and generates a new file. Check the recording epoch in the recording template.

  • Manual stop or restart: Calling the stop or restart command of RealTimeRecordCommand forces the file to be split.

A live stream was split into multiple recordings. How do I merge them into one file?

The merging method depends on the storage method:

Record to VOD

After you enable the automatic merging option in the recording template, the system automatically merges the multiple files generated by recording epoch splitting for the same live stream into one file when the stream ends. Both the merged file and the original recordings are kept in ApsaraVideo VOD.

Note: Automatic merging takes some processing time depending on the length and number of the files. It does not complete in real time.

Record to OSS

When you record to OSS, you can merge the recorded content in the following ways (the M3U8 format must be included):

  • Index-based editing: In the ApsaraVideo Live console, choose Features > Live recording, open the recording file management page, use the index-based editing feature, select a time range, and then save a new M3U8 file.

  • Call an API operation: Call the CreateLiveStreamRecordIndexFiles operation to create a new manifest. TS segment information is retained for only 3 months.

Is the recorded M3U8 file a complete index or a fragment?

The M3U8 file generated by recording is a complete manifest. It contains the reference list of all TS segments in the corresponding time range. The player loads the segments sequentially through this index for complete playback. It is not a single video fragment.

Index-based editing generates only new M3U8 files. How do I convert a recording to MP4?

Use ApsaraVideo Media Processing to transcode the M3U8 file to the MP4 format. For more information, see Submit transcoding jobs.

The stream interruption stitching duration is set too long (for example, 6 hours), so recordings are unavailable for a long time?

The stream interruption stitching duration determines how long the system waits for stream ingest to resume. If you set it to 21,600 seconds (6 hours), the system waits 6 hours after an interruption before it determines that the live stream has ended and generates the file.

Recommendation: Keep the default value of 180 seconds. If your business requires long interruption recovery, such as class breaks, increase the value moderately, but do not set it too high. To get the file immediately after the live stream ends, call the cancel_delay command of the RealTimeRecordCommand operation to end the wait.

Can I view the current recording before the live stream ends?

If the live stream duration does not exceed the recording epoch, the recording is usually generated after the live stream ends. To get the current recording while the live stream is ongoing, call the RealTimeRecordCommand operation to refresh the recorded content:

realTimeRecordCommandRequest.setCommand("restart");

This command forces the current recording process to end and generates the file immediately. The system then automatically starts a new round of recording. If the live stream is configured with multiple storage formats, this operation refreshes all formats at once.

When I enable transcoded stream recording for multi-bitrate single channel ingest, are multiple recordings generated?

If the ingest side uses multi-bitrate single channel ingest and the recording configuration enables transcoded stream recording, the system generates an independent recording for each bitrate. To record only the origin stream, clear the transcoded stream option in the recording content of the recording template.

The suffix of a recording folder (or file name) has the following meanings:

  • -fhd: full high definition (such as 1080P).

  • -hd: high definition (such as 720P).

  • No suffix: usually the origin stream or the default bitrate.

    The multiple files generated by multi-bitrate recording are billed as multiple concurrent streams for the monthly peak fee. If you record only the origin stream, it is billed as one stream.

Callbacks for recording

How do I get a notification when recording completes?

Live stream recording can actively push recording file information to your business system through recording callbacks. The callback configuration method depends on the storage method:

  • Record to OSS: Configure the recording callback URL in the ApsaraVideo Live console (Features > Event Callbacks). After a recording is generated, the system sends an HTTP POST request to this URL. The request contains information such as the file path and duration.

  • Record to VOD: Configure recording completion notifications in the ApsaraVideo VOD service. Set the Video Upload Complete event callback in the ApsaraVideo VOD console to get the notification. These notifications are not configured in ApsaraVideo Live.

Why do I not receive recording callback notifications?

Check the following items:

  • Make sure the callback URL is accessible. The callback URL must support HTTP POST requests and must not return a 301/302 redirect. If the URL is configured with a redirect, the callback fails.

  • Make sure the callback URL returns an HTTP 200 response within 5 seconds. If the callback times out (5 seconds), the system retries up to 5 times at intervals of 1 second. If all retries fail, the callback is discarded.

  • Make sure the callback is configured in the correct service. For recordings stored in OSS, configure the callback in ApsaraVideo Live. For recordings stored in VOD, configure the callback in ApsaraVideo VOD.

  • Make sure the callback URL is correct. The callback URL must be a complete HTTP/HTTPS URL, and your server firewall must not block requests from Alibaba Cloud.

    After you address the preceding items, trigger a new recording and verify that the callback arrives. If callbacks are still missing, submit a ticket to contact Alibaba Cloud technical support.

The recording callback is not triggered, or the recording is shorter than the configured duration. Can the playback still be generated?

Callback triggering is bound to the file generation mechanism. After the system detects a stream interruption, it waits for the stream interruption stitching duration (180 seconds by default. For more information, see How long after a live stream ends can I view the recording? Can the recording be generated immediately? in File generation and segmentation). Only if ingest does not resume before the timeout does the system determine that the live stream has ended, generate the file, and trigger the callback. If the actual live stream duration does not reach the stream interruption stitching duration and you did not stop recording manually, the callback may not be triggered.

As long as the actual live stream duration meets the minimum recording conditions (such as exceeding 15 minutes or ending with a normal stream interruption), the playback file is generated and the callback is triggered even if the duration is shorter than the configured upper limit of the recording epoch (for more information, see What is the purpose of the recording epoch? in File generation and segmentation). The recording epoch only controls the maximum split duration of a single file. It is not the minimum threshold for generating a file.

How do I make sure no recording is missed? Is there another way besides callbacks to get recording information?

Due to network exceptions or other reasons, a small number of recording callbacks may be lost. Combine callbacks with active queries to make sure you get all recordings:

How do I get the MP4 playback URL in the recording callback?

The file_url field in the recording callback returns the address of the file directly generated by live recording. If you configured the M3U8 storage format, the callback returns the M3U8 file address.

To get an MP4 playback URL:

  • Record to VOD: Configure a transcoding template in ApsaraVideo VOD. After a recording is uploaded, transcoding is automatically triggered. After transcoding completes, get the MP4 URL through the transcoding complete callback of ApsaraVideo VOD, or call the GetPlayInfo operation.

  • Record to OSS: If you also selected the MP4 format in the recording template, the system directly generates an MP4 file and returns the corresponding URL in the callback. You can also use ApsaraVideo Media Processing to transcode the M3U8 file to MP4.

Why does file_url in the recording callback not return the transcoded stream address?

The file_url field returns the address of the file directly generated by the live recording (see How do I get the MP4 playback URL in the recording callback?). When the transcoding template is enabled to Trigger Transcoding, if no audience is actually playing, the transcoded stream will not be generated, causing the file_url in the recording callback to be empty or only the source stream address to be returned.

Troubleshoot as follows:

  • Check whether the corresponding transcoded file exists in OSS.

  • Check whether the transcoding template has triggered transcoding enabled.

If the business strongly depends on transcoding stream recording, please disable triggering transcoding in the transcoding template. After closing, as long as there is push flow will be transcoded. If you only need to save the original picture, record the source stream.

How do I pass custom parameters through to the recording callback?

You can add parameters prefixed with callback_ to the ingest URL. The system passes these parameters through to the recording callback. For example:

Sample ingest URL: rtmp://push.example.com/live/stream1?callback_taskid=12345&auth_key=xxx

The recording callback contains: "push_args": "callback_taskid=12345"

Note: This capability works only for the parameters in the origin stream ingest URL. Callbacks for transcoded streams do not contain this information.

I received multiple recording callbacks for the same stream. Is this normal?

Multiple callbacks are generated in the following cases:

  • Epoch splitting: When the live stream lasts longer than the recording epoch, one callback is triggered each time a file is generated.

  • Interruption timeout splitting: After an interruption exceeds the stitching duration, resuming ingest generates a new file and a new callback.

  • Automatic and manual recording at the same time: If you call RealTimeRecordCommand to start manual recording while automatic recording is in progress, duplicate files may be generated.

  • Multiple storage formats: Each format (M3U8, FLV, MP4, and so on) triggers its own callback after the file is generated.

    If you receive duplicate callbacks with identical content, check whether automatic recording and manual recording (RealTimeRecordCommand) are enabled at the same time.

How does the on-demand recording callback mechanism work? Why does on-demand recording not start?

On-demand recording works through HTTP callbacks. When stream ingest starts, the system requests the callback URL that you configured. The recording starts only when your interface returns NeedRecord:true. Note the following:

  • You must first specify the on-demand callback URL in the event callback configuration. The callback URL must support HTTP POST requests and return a response within 5 seconds.

  • Your callback interface must return HTTP 200. If it returns a non-200 status code such as 400, the system cannot get the decision result and recording does not start.

  • On-demand recording ends after the stream is interrupted and the stitching duration buffer elapses. You can also call RealTimeRecordCommand with the stop command to end recording.

  • If you do not need per-stream control, use automatic recording instead. The recording is automatically generated about 3 minutes after stream ingest ends.

Do recording callbacks support internal network addresses or MNS notifications?

No. The live callback URL must be accessible from the public network. Internal network addresses are not supported. Callbacks support only HTTP/HTTPS. Message services such as MNS are not supported. If your business system is deployed on an internal network, expose the callback receiver through a public gateway.

Are scheduled recording callbacks supported?

ApsaraVideo Live does not support a scheduled normal recording callback similar to the screenshot callback. A recording callback is triggered only when a recording task starts, ends, or encounters an exception. This is consistent with the capability boundary described in Do recording callbacks support internal network addresses or MNS notifications?.

The recording length does not match the actual live stream duration. How do I troubleshoot?

A mismatch between the recording length and the live stream duration is usually caused by stream ingest interruptions, epoch splitting, or stream interruption stitching. Call the DescribeLiveStreamRecordContent operation to query all recorded time ranges of the stream, verify the start and end time covered by each file, and then stitch and compare them.

Access and playback

Why can't I watch a recording in the ApsaraVideo Live console?

Troubleshoot the issue step by step:

  • Check the OSS bucket permissions. If the bucket ACL is private, the ApsaraVideo Live console cannot get the access URL of the file, and playback fails. Solutions:

    • Change the read and write permission of the bucket to public-read. For more information, see Bucket ACL.

    • Alternatively, get a temporary access URL by using an OSS presigned URL, and play the file in another player. For more information, see Download or preview a file using a signed URL.

  • Check the HTTPS configuration. The ApsaraVideo Live console runs in an HTTPS environment and cannot load resources over HTTP. If you use a custom domain name for the OSS bucket, you must configure an SSL certificate. If you use the default OSS domain name, no configuration is needed because an HTTPS certificate is built in. For more information, see Deploy an SSL certificate.

  • Make sure the OSS bucket allows cross-origin access (CORS). Recommended configuration:

  • Check whether the SSL certificate is valid. If the SSL certificate of the CDN or the OSS custom domain name has expired or is invalid, the browser refuses to load the resource. Check the certificate validity in the certificate management service and renew the certificate in time.

If the issue persists after you confirm that all configurations are correct, submit a ticket to contact Alibaba Cloud technical support. For information about how to submit a ticket, see Contact us.

How do I get the playback URL of a recording stored in OSS?

The method depends on the access permissions of the bucket:

  • Public-read bucket: Play the file directly through its OSS URL. The format is https://{BucketName}.oss-{Region}.aliyuncs.com/{ObjectName}.

  • Private bucket: Use an OSS presigned URL to generate a temporary access URL. For more information, see Download or preview a file using a signed URL.

    Note: For recordings stored in VOD, get the playback URL through the GetPlayInfo operation of ApsaraVideo VOD. Do not use OSS signed URLs directly.

Error 4400 or a mixed content error occurs when I play a recording?

This is usually caused by an HTTPS/HTTP protocol mismatch. If your web page runs in an HTTPS environment (such as the ApsaraVideo Live console), the browser blocks video resources loaded over HTTP.

Solutions:

  • Configure an SSL certificate for the OSS custom domain name and play the file over an HTTPS URL.

  • Alternatively, test playback in a player in an HTTP environment, such as the Alibaba Cloud Player Diagnostics tool.

The recorded video shows a blank screen with audio only, or shows video without audio?

This is usually caused by issues on the ingest side. Live stream recording only converts the container format and does not modify the encoded content. Troubleshoot as follows:

  • Blank screen without video: The ingest side may not be outputting video frames correctly (for example, screen sharing does not capture the screen correctly, or the camera does not work properly), or the video codec format is not supported.

  • Video without audio: The ingest side may not be sending audio data, or the audio codec format is not AAC/MP3.

  • Pixelated screen or stuttering playback: Encoding anomalies on the ingest side (such as an excessive keyframe interval or unstable timestamps) are preserved in the recording.

    Download the recording and verify it with a local player such as VLC to rule out player compatibility issues.

Do recordings generated by live stream recording contain watermarks?

Live stream recording only converts the container format and does not modify the encoded content. Therefore, recordings do not contain the watermark that viewers see while watching the live stream. To record watermarked videos, add the watermark on the ingest side, or use ApsaraVideo VOD or ApsaraVideo Media Processing to perform post-processing on the recordings.

Query and management

How do I get recordings after a live stream is recorded?

The method depends on the storage method:

Record to VOD

  • ApsaraVideo Live console: choose Features > Live recording, open the recording file management page, and then click the Stored in VOD tab.

  • ApsaraVideo VOD console: choose Media Library > Audio/Video.

  • API: call the GetVideoList or GetVideoInfo operation of ApsaraVideo VOD.

Record to OSS

  • ApsaraVideo Live console: choose Features > Live recording, open the recording file management page, and then click the Stored in OSS tab.

  • OSS console: view the files directly by the storage path. The default path is the record/{AppName}/{StreamName}/ directory.

  • API: call the DescribeLiveStreamRecordIndexFiles operation.

    For example, to retrieve the recordings of the live stream aliyundoc.com/live/teststream from 09:00:00 on 2019-02-15 to 21:00:00 on 2019-02-15 (UTC+8), call the DescribeLiveStreamRecordContent operation as follows. The StartTime and EndTime parameters are in UTC. Convert the time from your local time zone.

/?AppName=live
&DomainName=aliyundoc.com
&StreamName=teststream
&StartTime=2019-02-15T01:00:00Z
&EndTime=2019-02-15T13:00:00Z
&<Common request parameters>

"Data has expired" appears when I query index files, or historical recordings cannot be found?

The data retention policy for recording index information in ApsaraVideo Live is as follows:

  • Retention period of the recording index file: 6 months. After that, you cannot query it through the DescribeLiveStreamRecordIndexFiles operation or the console.

  • Retention period of TS segment information: 3 months. After that, you cannot use recording index-based editing.

    Note: Expired index information does not affect the actual recordings stored in OSS or VOD. The files still exist. To view historical files, go to the OSS console and search by the storage path, or search in the media library of ApsaraVideo VOD.

As a best practice, maintain the metadata of recordings, such as the file path, duration, and time, in your own business system for long-term queries.

Can I call an API operation to download recordings stored in OSS?

ApsaraVideo Live does not provide an API operation to download recordings directly. To download recordings:

  • OSS download: The recordings are actually stored in OSS. Download them through the OSS SDK or the OSS console. For more information, see Simple download.

  • Presigned URL: For private buckets, generate a presigned URL and download the file through a browser or tool.

How do I delete recordings? What is the difference between deleting OSS recordings and VOD recordings?

For recordings stored in OSS:

Method

Description

ApsaraVideo Live console

Select the files on the recording file management tab and delete them. You can select Also delete recordings stored in OSS.

ApsaraVideo Live API

Call the DeleteLiveStreamRecordIndexFiles operation.

Delete directly in OSS

Go to the OSS console or use the OSS API to delete the actual files.

When you synchronously delete OSS files through the console or the ApsaraVideo Live API, you must create the AliyunMTSVideoLifecycleRole service role and attach the AliyunMTSVideoLifecycleRolePolicy policy. To complete one-click authorization, click Authorize.

For recordings stored in VOD:

Manage and delete them through ApsaraVideo VOD. Use the media library of the ApsaraVideo VOD console, or call the DeleteVideo operation of ApsaraVideo VOD. Do not use the DeleteLiveStreamRecordIndexFiles operation of ApsaraVideo Live to delete VOD recordings.

How do I get the duration of a recording?

  • Record to OSS: Call the DescribeLiveStreamRecordIndexFiles operation. The response contains the Duration field.

  • Record to VOD: Call the GetVideoInfo operation of ApsaraVideo VOD to get the video duration.

An insufficient permissions error occurs when I call the recording deletion operation?

When you call the DeleteLiveStreamRecordIndexFiles operation with synchronous OSS file deletion (RemoveFile=true), make sure that:

  • The AliyunMTSVideoLifecycleRole role is created and authorized.

  • If you call the operation as a RAM user, the user has the corresponding OSS deletion permissions.