Snapshots

更新时间:
复制 MD 格式

The snapshot service for real-time media processing lets you capture snapshots from live streams and save them to Alibaba Cloud OSS. This topic explains how to use the snapshot feature.

Snapshot features

Features

You can capture snapshots from a live stream at a specified interval and save them to Alibaba Cloud OSS. This feature offers two storage modes:

Mode

Description

Overwrite snapshot

Each new snapshot overwrites the previous snapshot.

Real-time snapshot

New snapshots are saved without overwriting previous files and are named using a UNIX timestamp.

Limitations

  • A single account can run a maximum of 100 concurrent snapshot jobs. If you need a higher limit, contact your account manager.

  • The input live stream for a snapshot job must use RTMP.

  • Snapshots can only be saved to Alibaba Cloud OSS. The only supported output format is JPG.

Create a snapshot template

Console

  1. Log in to the Intelligent Media Service console.

  2. In the upper-left corner, select the region you need.

  3. In the left-side navigation pane, choose Real-time Media Processing> Template Management.

  4. On the Snapshot tab, create a snapshot template.

    Parameter

    Description

    Template Name

    Enter a name for the snapshot template.

    Snapshot Frequency

    The snapshot interval, in seconds. The value must be between 5 and 3,600.

    The service captures snapshots on keyframes.

    Storage Rule

    • Overwrite snapshot: Each new snapshot overwrites the previous snapshot. The naming convention is snapshot/{JobId}.jpg.

    • Real-time snapshot: New snapshots are saved without overwriting previous files. The naming convention is snapshot/{JobId}/{Sequence}/{UnixTimestamp}.jpg.

    Note

    The only supported output format for snapshots is JPG.

API

Call the CreateLiveSnapshotTemplate operation to create a custom template.

Create a snapshot job

Console

  1. Log in to the Intelligent Media Service console.

  2. In the upper-left corner, select the region you need.

  3. In the left-side navigation pane, choose Real-time Media Processing > Job Management.

  4. Create a real-time media snapshot job on the Snapshot tab.

    Parameter

    Description

    Job Name

    Enter a name for the snapshot job.

    Storage Location

    Select a location to store snapshots. Only Alibaba Cloud OSS is supported. If a storage location is not available, you can configure one. For more information, see Configure a storage location.

    Select Template

    Select a snapshot template.

    Live Stream

    Enter a valid URL for the live stream. Only RTMP is supported.

    Callback URL

    Enter a callback URL for this job only. If left empty, the service uses the URL configured in Callback Settings.

API

Call the SubmitLiveSnapshotJob operation to submit a snapshot job.

Query snapshot job details

Callback notifications

You can query the details of real-time media snapshot jobs by receiving live streaming snapshot callbacks. For more information, see Callback Event Overview.

API

Call the GetLiveSnapshotJob operation to query the details of a snapshot job.

Retrieve snapshots

After a snapshot job starts, you can retrieve the generated snapshots and process them as needed.

Console

  1. Log in to the Intelligent Media Service console.

  2. In the upper-left corner, select the region you need.

  3. In the left-side navigation pane, choose Real-time Media Processing> File Management.

  4. On the Snapshot tab, you can obtain the snapshot files of the live stream.

API

Call the ListLiveSnapshotFiles operation to retrieve the snapshots from your live stream.

Query snapshot job usage

  1. Log in to the Intelligent Media Service console.

  2. In the left-side navigation pane, choose Data Center > Usage Query.

  3. On the Real-time Job Usage tab, in the Live Snapshot section, view the duration usage of jobs or export the details.

    Note

    To ensure data security, the download link for the exported file is valid for 30 minutes. If the link expires, refresh the page to generate a new one.

API reference

API operations for real-time media snapshots