Prerequisites
The Snapshots feature stores snapshot files in a bucket. You must activate Object Storage Service (OSS) and create at least one bucket to store the snapshot files. For more information, see Activate OSS and Create a bucket.
Important The bucket must be in the same region as the live center of the streaming domain. Cross-region snapshots are not supported.
Snapshot rules
You can configure Snapshots for each AppName. You can set snapshot rules for all stream ingests under a specific AppName.
Note If you set AppName to an asterisk (*), the snapshot rule applies to all stream ingests under the domain name.
When you configure the Snapshots feature, you can choose from two snapshot types: overwrite and real-time.
Overwrite snapshots: Each new snapshot overwrites the previous one.
Real-time snapshots: Each new snapshot is saved without overwriting the previous one. Snapshots are stored incrementally.
Snapshots currently supports only the JPG format.
Note You can select both types. You must select at least one type.
Feature overview
Note A newly configured snapshot template does not apply to ongoing live streams. You must restart the stream ingest for the template to take effect.
Configure the video snapshot feature
You can configure the Snapshots feature using one of the following methods:
Configure the snapshot feature in the console
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Snapshots. On the Snapshots page, click the Snapshot Settings tab.
Select the streaming domain to configure.
Click Add.
Configure the snapshot template.

The following table describes the parameters for a snapshot template.
Parameter | Description |
Application Name | The application name. The Application Name must be the same as the AppName used for stream ingest. To configure snapshots for a domain name, enter an asterisk (*). |
Snapshot Interval | The snapshot interval in seconds. Valid values: 5 to 3600. |
Storage Location | Select the storage location for snapshot files in OSS. The OSS bucket must be in the same region as the live center of the streaming domain. Cross-region snapshots are not supported. |
Storage Mode | Two storage methods are available. You can select both. Overwrite: Snapshots are taken at the specified interval. Each new snapshot overwrites the previous one. New: Snapshots are taken at the specified interval. New snapshots are stored sequentially in OSS in the N+1 (N≥0) order.
Note If you select both, snapshots are taken using both methods. |
Note After you complete the configuration, snapshots are taken and stored for all specified Application Names under the domain name based on the template.
Changes to snapshot settings take effect after you restart the stream ingest.
Click OK.
Manage snapshot files
View snapshot files
You can view snapshot files in one of the following ways.
View snapshot files in the console
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Snapshots. On the Snapshots page, click Snapshot Management.
Select the domain name and time range. Then, enter or select the AppName and StreamName.
Click Search to view the snapshots within the selected time range. If you cannot view the snapshots, make sure the access control list (ACL) of the OSS bucket is set to public-read. For more information, see Configure the ACL of an OSS bucket.
Move the pointer over an image to view a larger version or copy the snapshot URL.
View snapshot files in OSS
When you configured the snapshot feature, you specified the storage address for snapshot files in OSS. To view snapshot files in OSS, see List objects in OSS.
Delete snapshot files
ApsaraVideo Live stores snapshot file information, such as the AppName, StreamName, and OSS storage path. The snapshot files are stored in OSS. To delete the files from OSS when you delete the snapshots, you must create the AliyunMTSVideoLifecycleRole service role and attach the AliyunMTSVideoLifecycleRolePolicy system policy to the role.
Authorization procedure
You must grant permissions before you can delete snapshots or recordings in the ApsaraVideo Live console. To grant the required permissions, create and authorize a RAM role in the RAM console. Then, you can log on to the ApsaraVideo Live console to delete the files.
Create a service role
Log on to the RAM console as a RAM administrator.
In the navigation pane on the left, choose .
On the Roles page, click Create Role.

On the Create Role page, set Principal Type to Cloud Service. Then, select a trusted service and click OK.

Note From the Principal Name drop-down list, select ApsaraVideo Media Processing.
In the Create Role dialog box, enter "AliyunMTSVideoLifecycleRole" in the Role Name field and click OK.
After the role is created, on its Basic Information page, click the Permissions tab.
Click Precise Permission. Configure the parameters as follows:
After the configuration is complete, click OK.
You can delete snapshot files in one of the following ways:
Delete snapshot files in the console
Log on to the ApsaraVideo Live console.
In the navigation pane on the left, choose Feature Management > Snapshots. On the Snapshots page, click Snapshot Management.
Select the domain name and time range. Then, enter or select the AppName and StreamName.
Move the pointer over an image and click the delete icon to delete a single snapshot.
To delete multiple snapshots at once, select the snapshots and click Batch Delete. You can delete up to 200 snapshots at a time.
Delete snapshot files by calling an API
Call the DeleteSnapshotFiles operation to delete snapshot files. This also deletes the files stored in OSS.
You can configure snapshot callbacks to save snapshot information, including timestamps, to your business system. Then, you can delete the corresponding files based on a custom policy, such as a scheduled cleanup. For more information, see Live stream snapshot callbacks.