SubmitSnapshotJob

Updated at:

Submits a snapshot job. You can specify the ID or URL of a media file, the snapshot time, and the format. The system generates snapshots based on these parameters and saves them to the specified location.

Operation description

This operation is an asynchronous operation. After you submit a job, a job ID is returned. The job is not completed immediately and enters a background queue for asynchronous execution. The final result is sent through a callback notification. You can also call the operation to query the details of a snapshot job to actively query the job status.

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

SampleJob

Input

object

Yes

The snapshot input.

Type

string

Yes

The input type. Valid values:

  • OSS: the URL of an OSS object.

  • Media: the ID of a media asset.

Media

Media

string

Yes

The input media.

  • If Type is set to OSS, enter the OSS URL.

  • If Type is set to Media, enter the media asset ID.

The OSS URL must follow these rules:

  1. oss://bucket/object

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

Note

The OSS bucket in the URL must be added to the IMS storage management before it can be used.

oss://bucket/object.mp4

Output

object

Yes

The snapshot output.

Type

string

Yes

The input type. Valid values:

  • OSS: the URL of an OSS object.

  • Media: the ID of a media asset.

OSS

Media

string

Yes

The output media.

  • If Type is set to OSS, enter the OSS URL.

  • If Type is set to Media, enter the media asset ID.

The OSS URL must follow these rules:

  1. oss://bucket/object

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

In the URLs, bucket is the name of the OSS bucket that resides 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 snapshot, the object must contain the "{TileCount}" placeholder.

  • For WebVTT snapshots, the object suffix must be ".vtt".

Note

The OSS bucket in the URL must be added to the IMS storage management before it can be used.

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

TemplateConfig

object

Yes

The snapshot template configuration.

TemplateId

string

Yes

The ID of the template.

****96e8864746a0b6f3****

OverwriteParams

object

No

The override parameters.

Type

string

No

The snapshot type.

Sprite

FrameType

string

No

The frame type.

intra

Count

integer

No

The number of snapshots.

5

Interval

integer

No

The snapshot interval. Unit: seconds.

10

Time

integer

No

The start time of the snapshot. Unit: milliseconds.

1000

Width

integer

No

The width of the output image.

720

Height

integer

No

The height of the output image.

480

BlackLevel

integer

No

The threshold for filtering black screen images in the first frame of multi-frame snapshots.

30

PixelBlackThreshold

integer

No

The threshold for determining whether a pixel is a black pixel.

70

SpriteSnapshotConfig

object

No

The sprite snapshot configuration.

CellWidth

integer

No

The width of a single image. Default value: the width of the snapshot output resolution.

720

CellHeight

integer

No

The height of a single image. Default value: the height of the snapshot output resolution.

480

Padding

integer

No

The spacing between images. Default value: 0. Unit: pixels.

20

Margin

integer

No

The margin width. Default value: 0. Unit: pixels.

20

Columns

integer

No

The number of columns for image stitching.

20

Lines

integer

No

The number of rows for image stitching.

20

Color

string

No

The background color.

#000000

IsSptFrag

boolean

No

The WebVTT snapshot configuration. Specifies whether to stitch the output.

true

ScheduleConfig

object

No

The scheduling configuration.

PipelineId

string

No

The ID of the pipeline.

****96e8864746a0b6f3****

UserData

string

No

The custom user data.

{"test parameter": "test value"}

Response elements

Element

Type

Description

Example

object

PlainResponse

RequestId

string

The request ID.

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

JobId

string

The job ID.

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