SubmitSnapshotJob

更新时间:
复制 MD 格式

Call this operation to submit a snapshot job to asynchronously capture snapshots from a video.

Operation description

  • This is an asynchronous API. After you submit a job, a job ID is returned. The job is then queued for asynchronous processing. The final result is sent via a callback notification. You can also call the GetTask operation to query the job status.

  • Currently, only snapshots in JPG format are supported.

  • When a snapshot job is complete, the system generates a SnapshotComplete event notification with EventType=SnapshotComplete and SubType=SpecifiedTime.

QPS limit

This operation has a limit of 30 queries per second (QPS) per user. The system subjects calls that exceed this limit to rate limiting, which may impact your business. Plan your calls accordingly. For more information, see QPS limit.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vod:SubmitSnapshotJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

VideoId

string

No

The ID of the video. You can obtain the video ID in one of the following ways:

  • Log in to the ApsaraVideo for VOD console. In the left-side navigation pane, choose Media Files > Audio/Video to view the video ID.

  • Get the VideoId from the response to the CreateUploadVideo operation. This operation provides the upload URL and credentials.

  • After a video is uploaded, get the VideoId from the response to the SearchMedia operation.

d3e680e618708efbf2cae7cc9312****

SpecifiedOffsetTime

integer

No

The start time for capturing the snapshot.

  • Unit: milliseconds.

  • Default value: 0.

0

Width

string

No

The width of the snapshot, in pixels (px). Valid values: [8,4096]. The default is the width of the source video.

1280

Height

string

No

The height of the snapshot, in pixels (px). Valid values: [8,4096]. The default is the height of the source video.

720

Count

integer

No

The number of snapshots to capture. Default value: 1.

1

Interval

integer

No

The interval for capturing snapshots. The value must be greater than or equal to 0.

  • Unit: seconds.

  • Default value: 1.

  • If you set Interval to 0, the system captures snapshots at even intervals based on the video duration and the value of Count.

1

SpriteSnapshotConfig

string

No

The configuration for generating a sprite. If you specify this parameter, the system generates a sprite. For more information about the parameter structure, see SpriteSnapshotConfig.

{'CellWidth': 120, 'CellHeight': 68, 'Columns': 3,'Lines': 10, 'Padding': 20, 'Margin': 50}

SnapshotTemplateId

string

No

The ID of the snapshot template.

  • We recommend creating a snapshot template before you specify its ID. For more information, see AddVodTemplate.

  • If you specify SnapshotTemplateId, the system ignores all other request parameters except for Action and VideoId.

f5b228fe693bf55bd87b789****

UserData

string

No

Custom settings in JSON format. This parameter allows you to pass custom user data and specify a callback URL. For more information about the parameter structure, see UserData.

Note

To use the message callback feature, you must first configure an HTTP callback URL and select the corresponding event types in the console. Otherwise, the callback settings will not take effect.

{"MessageCallback":{"CallbackURL":"http://.example.aliyundoc.com"},"Extend":{"localId":"xxx","example":"www"}}

SpecifiedOffsetTimes

array

No

An array of specific time points in the video to capture snapshots. Unit: milliseconds. You can specify up to 30 time points.

integer

No

A specific time point, in milliseconds.

1000

ReferenceId

string

No

A custom ID that can contain lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_). The ID must be 6 to 64 characters long and unique per user.

123-123

Note

You must specify at least one of Count or Interval. If you specify both, the system uses the parameter that results in fewer snapshots.

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

25818875-5F78-5EB0-4AF6-D7393642****

SnapshotJob

object

Information about the snapshot job.

JobId

string

The snapshot job ID.

ad90a501b1b94b72374ad0050464****

Examples

Success response

JSON format

{
  "RequestId": "25818875-5F78-5EB0-4AF6-D7393642****",
  "SnapshotJob": {
    "JobId": "ad90a501b1b94b72374ad0050464****"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.