SubmitSnapshotJob

更新时间:
复制 MD 格式

This API submits a snapshot job. Specify a media file by its ID or URL, a time point, and the desired format. The API then generates the snapshot and saves it to the specified location.

Operation description

This is an asynchronous interface. Submitting a task returns a task ID and queues it for asynchronous processing. A callback delivers the final result. Alternatively, you can check the task status by querying screenshot task details.

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

ice:SubmitSnapshotJob

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The name of the snapshot job.

SampleJob

Input

object

Yes

The input for the snapshot job.

Type

string

Yes

The type of the input. Valid values:

  • OSS: an OSS file URL.

  • Media: a media asset ID.

Media

Media

string

Yes

The input media asset.

  • If Type is OSS, specify the OSS URL of the input file.

  • If Type is Media, specify the ID of the media asset.

The OSS URL must be in one of the following formats:

  1. oss://bucket/object

  2. http(s)://bucket.oss-[RegionId].aliyuncs.com/object
    In these formats, bucket is the name of an OSS bucket located in the same region as the current project, and object is the file path.

Note

The OSS bucket specified in the URL must be added to IMS storage management before use.

oss://bucket/object.mp4

Output

object

Yes

The output destination for the snapshot job.

Type

string

Yes

The type of the output. Valid values:

  • OSS: an OSS file URL.

  • Media: a media asset ID.

OSS

Media

string

Yes

The output media asset.

  • If Type is OSS, specify the OSS URL for the output file.

  • If Type is Media, specify the ID of the output media asset.

The OSS URL must be in one of the following formats:

  1. oss://bucket/object

  2. http(s)://bucket.oss-[RegionId].aliyuncs.com/object

In these formats, bucket is the name of an OSS bucket located in the same region as the current project, and object is the file path.

  • When capturing multiple static snapshots, the object must contain the {Count} placeholder.

  • When capturing a sprite, the object must contain the {TileCount} placeholder.

  • For WebVTT snapshots, the filename in the object path must end with .vtt.

Note

The OSS bucket specified in the URL must be added to IMS storage management before use.

oss://test-bucket/output-{Count}.jpg

TemplateConfig

object

Yes

The snapshot template configuration.

TemplateId

string

Yes

The snapshot template ID.

****96e8864746a0b6f3****

OverwriteParams

object

No

Parameters used to override settings in the specified template.

Type

string

No

The snapshot type.

Sprite

FrameType

string

No

The frame type.

intra

Count

integer

No

The number of snapshots to capture.

5

Interval

integer

No

The interval between snapshots.

10

Time

integer

No

The start time for capturing snapshots.

1000

Width

integer

No

The output image width.

720

Height

integer

No

The output image height.

480

BlackLevel

integer

No

The threshold for detecting and filtering black content in the first frame. This applies only to multi-frame snapshots.

30

PixelBlackThreshold

integer

No

The threshold for determining whether a pixel is black.

70

SpriteSnapshotConfig

object

No

The sprite configuration.

CellWidth

integer

No

The width of each tile. Default: the width of the output snapshot.

720

CellHeight

integer

No

The height of each tile. Default: the height of the output snapshot.

480

Padding

integer

No

The padding between tiles, in pixels. Default value: 0.

20

Margin

integer

No

The margin around the sprite, in pixels. Default value: 0.

20

Columns

integer

No

The number of columns in the sprite grid.

20

Lines

integer

No

The number of rows in the sprite grid.

20

Color

string

No

The background color.

#000000

IsSptFrag

boolean

No

Specifies whether to stitch snapshots into a single sprite. This applies only to WebVTT snapshots.

true

ScheduleConfig

object

No

The scheduling configuration.

PipelineId

string

No

The pipeline ID.

****96e8864746a0b6f3****

UserData

string

No

Custom user data, passed as a JSON-formatted string.

{"test parameter": "test value"}

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

A unique identifier for the request.

******11-DB8D-4A9A-875B-275798******

JobId

string

The ID of the submitted job.

****20b48fb04483915d4f2cd8ac****

Examples

Success response

JSON format

{
  "RequestId": "******11-DB8D-4A9A-875B-275798******",
  "JobId": "****20b48fb04483915d4f2cd8ac****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.