Description
You can call this operation to submit a video screenshot job and start asynchronous screenshot. This operation supports normal snapshots and sprite snapshots.
Notes:
- Currently, images are generated only in JPG format.
- After a video snapshot job is completed, ApsaraVideo for VOD sends a SnapshotComplete event notification that contains EventType=SnapshotComplete and SubType=SpecifiedTime.
Request parameters
Name | Type | Required | Description |
---|---|---|---|
Action | String | Yes | The operation that you want to perform. Set the value to SubmitSnapshotJob. |
VideoId | String | Yes | The video ID. |
Count | Long | No | The maximum number of snapshots. Default value: 1. |
Interval | Long | No | The snapshot interval. The value must be greater than or equal to zero. Unit: seconds. If this parameter is set to 0, snapshots are taken at even intervals based on the video duration divided by the value of the Count parameter. Default value: 1. |
SpecifiedOffsetTime | Long | No | The start time of the specified snapshot time period. Unit: milliseconds. Default value: 0. |
Width | String | No | The width of the snapshot. Valid values: 8 to 4096. Default value: the width of the video source file. Unit: pixels. |
Height | String | No | The height of the snapshot. Valid values: 8 to 4096. Default value: the height of the video source file. Unit: pixels. |
SpriteSnapshotConfig | String | No | The sprite snapshot configuration. If you set this parameter, sprite snapshots are generated. |
SnapshotTemplateId | String | No | The snapshot template ID. We recommend that you construct a snapshot template before specifying its snapshot template ID. |
Notes:
- You must set at least either the Count or Interval parameter. If you set both of them, the setting with fewer snapshots generated prevails.
- If you set the SnapshotTemplateId parameter, you can set only the Action and VideoId parameters and skip other request parameters.
- For more information about how to create a snapshot template, see AddVodTemplate.
Response parameters
Name | Type | Description |
---|---|---|
RequestId | String | The GUID generated by Alibaba Cloud for the request. |
SnapshotJob | SnapshotJob | The video snapshot job information. |
Examples
Sample requests
https://vod.cn-shanghai.aliyuncs.com?Action=SubmitSnapshotJob&Video=d3e680e618708fef7cefbf2cae7cc931&TimeOffset=5&Count=1&Interval=0&Type=sprite&Width=640&Height=360&SpriteSnapshotConfig=%7b%22CellHeight%22%3a%2268%22%2c%22CellWidth%22%3a%22120%22%2c%22Columns%22%3a%2210%22%2c%22Lines%22%3a%2210%22%7d
Sample responses
{
"RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
"SnapshotJob": {
"JobId": "ad90a501b1b94ba6afb72374ad005046"
}
}
Error codes
Error code | Error message | HTTP status code | Description |
---|---|---|---|
InvalidVideo.NotFound | The video does not exist. | 404 | The error message returned when the specified video does not exist. |
NoSuchResource | The specified resource %s does not exist. | 404 | The error message returned when the specified resource does not exist. |
Forbidden.IllegalStatus | Status of the video is illegal. | 400 | The error message returned when the video status is invalid. You can only snapshot videos in the UploadSucc, Normal, Checking, or Blocked status. |