All Products
Search
Document Center

SubmitSnapshotJob

Last Updated: Mar 04, 2019

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

NameTypeRequiredDescription
ActionStringYesThe operation that you want to perform. Set the value to SubmitSnapshotJob.
VideoIdStringYesThe video ID.
CountLongNoThe maximum number of snapshots. Default value: 1.
IntervalLongNoThe 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.
SpecifiedOffsetTimeLongNoThe start time of the specified snapshot time period. Unit: milliseconds. Default value: 0.
WidthStringNoThe width of the snapshot. Valid values: 8 to 4096. Default value: the width of the video source file. Unit: pixels.
HeightStringNoThe height of the snapshot. Valid values: 8 to 4096. Default value: the height of the video source file. Unit: pixels.
SpriteSnapshotConfigStringNoThe sprite snapshot configuration. If you set this parameter, sprite snapshots are generated.
SnapshotTemplateIdStringNoThe 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

NameTypeDescription
RequestIdStringThe GUID generated by Alibaba Cloud for the request.
SnapshotJobSnapshotJobThe video snapshot job information.

Examples

Sample requests

  1. 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

  1. {
  2. "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
  3. "SnapshotJob": {
  4. "JobId": "ad90a501b1b94ba6afb72374ad005046"
  5. }
  6. }

Error codes

Error codeError messageHTTP status codeDescription
InvalidVideo.NotFoundThe video does not exist.404The error message returned when the specified video does not exist.
NoSuchResourceThe specified resource %s does not exist.404The error message returned when the specified resource does not exist.
Forbidden.IllegalStatusStatus of the video is illegal.400The error message returned when the video status is invalid. You can only snapshot videos in the UploadSucc, Normal, Checking, or Blocked status.