ApsaraVideo VOD allows you to capture snapshots based on a snapshot template. This topic describes how to create and use a snapshot template.
Create a snapshot template
- Log on to the ApsaraVideo VOD console.
- In the left-side navigation pane, choose .
- On the Snapshot Templates page, click Add Template. On the Create Snapshot Template page, create a snapshot template.
The supported snapshot types include Normal Snapshot, WebVTT, and Image Sprite. For more information, see Video snapshots.
The following table describes the parameters that you need to configure to create a snapshot template.Parameter Snapshot type Description Template Name Normal Snapshot, WebVTT, and Image Sprite The name of the snapshot template. Start Time Normal Snapshot, WebVTT, and Image Sprite The start time for capturing snapshots. The time is in the HH:MM:SS format. Snapshot Count Normal Snapshot, WebVTT, and Image Sprite The total number of snapshots. Snapshot Interval Normal Snapshot, WebVTT, and Image Sprite The interval between snapshots when multiple snapshots are captured. If you set this parameter to 0 or leave it empty, snapshots are evenly captured throughout the video duration. Size (Width × Height) Normal Snapshot, WebVTT, and Image Sprite The width and height of the snapshot. Unit: pixels. Note- If neither Width nor Height is specified, the snapshot width and height are the same as those of the input video.
- If only Width or Height is specified, the other parameter is automatically set based on the aspect ratio of the input video to ensure that the snapshots are not distorted.
Frame Type Normal Snapshot, WebVTT, and Image Sprite Valid values: Frame and Keyframe. Note If you select Keyframe, only keyframes are captured. If no keyframe is found at the specified time, the keyframe closest to the specified time is captured. Keyframes are captured faster than normal frames when the same snapshot rules are applied.Generate Image Sprite WebVTT If you do not enable this feature, snapshots are separately stored. If you enable this feature, snapshots are put into a single image. Arrangement (Rows x Columns) Image Sprite The width and height of snapshots in the image sprite. Note- If neither Rows nor Columns is specified, the snapshot width and height are the same as those of the input video.
- If only Rows or Columns is specified, the other parameter is automatically set based on the aspect ratio of the input video.
Row Space Image Sprite The space between the rows in the image sprite. Unit: pixels. Column Space Image Sprite The space between the columns in the image sprite. Unit: pixels. Background Color Image Sprite The background color of the image sprite. Retain Snapshots Image Sprite If you enable this feature, the original snapshots are retained. If you do not enable this feature, the original snapshots are not retained. - Click Save.
Manage snapshot templates
After you create a snapshot template, you can modify or delete the template.
On the Snapshot Templates page, find the template that you want to modify or delete and click Edit or Delete in the Actions column.
Note If you click Edit to modify template configurations, you cannot change the snapshot type.
Use a snapshot template
To use a snapshot template, you must add the snapshot template to a workflow when you upload or process the media file. For more information about how to use workflows, see Manage workflows.
- When you upload a media file, you can specify a workflow that contains a snapshot template. After the media file is uploaded, the workflow is automatically triggered and ApsaraVideo VOD automatically processes the media file. For more information, see Upload audio and video files.
- Alternatively, you can perform the following steps after you upload a media file to ApsaraVideo VOD: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Processing in the Actions column. In the dialog box that appears, click Use Workflow. Then, specify a workflow that contains a snapshot template to process the media file. . Find the media file that you want to manage and click