Tous les produits
Search
Centre de documentation

ApsaraVideo Media Processing:SubmitSnapshotJob

Dernière mise à jour :Aug 07, 2026

Soumet une tâche de capture d'instantané. Le service de traitement des médias (MPS) capture ensuite des instantanés et génère une image sprite à partir du fichier d'entrée.

Description de l'opération

  • La taille maximale d'un seul fichier d'entrée est de 100 Go. Le dépassement de cette limite peut entraîner l'échec de la tâche.

Testez maintenant

Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.

Test

Autorisation RAM

Le tableau ci-dessous décrit les autorisations nécessaires pour appeler cette API. Vous pouvez les définir dans une politique Resource Access Management (RAM). Les colonnes du tableau sont détaillées ci-dessous :

  • Action : les actions peuvent être utilisées dans l'élément Action des instructions de politique de permissions RAM pour accorder les autorisations nécessaires à l'exécution de l'opération.

  • API : l'API que vous pouvez appeler pour exécuter l'action.

  • Niveau d'accès : le niveau d'accès prédéfini accordé pour chaque API. Valeurs valides : create, list, get, update et delete.

  • Type de ressource : le type de ressource qui prend en charge l'autorisation pour exécuter l'action. Il indique si l'action prend en charge les permissions au niveau de la ressource. La ressource spécifiée doit être compatible avec l'action. Sinon, la politique sera inefficace.

    • Pour les API avec permissions au niveau de la ressource, les types de ressource requis sont marqués d'un astérisque (*). Spécifiez l'Alibaba Cloud Resource Name (ARN) correspondant dans l'élément Resource de la politique.

    • Pour les API sans permissions au niveau de la ressource, la valeur All Resources est affichée. Utilisez un astérisque (*) dans l'élément Resource de la politique.

  • Clé de condition : les clés de condition définies par le service. La clé permet un contrôle granulaire, applicable aux actions seules ou aux actions associées à des ressources spécifiques. En plus des clés de condition propres au service, Alibaba Cloud fournit un ensemble de clés de condition communes applicables à tous les services pris en charge par RAM.

  • Action dépendante : les actions dépendantes requises pour exécuter l'action. Pour mener à bien l'opération, l'utilisateur RAM ou le rôle RAM doit disposer des permissions pour toutes les actions dépendantes.

mts:SubmitSnapshotJob

create

*All Resource

*

Aucune Aucune

Paramètres de requête

Paramètre

Type

Requis

Description

Exemple

Input

string

Oui

L'entrée de la tâche. Pour plus d'informations, consultez Input.

{"Bucket":"example-bucket","Location":"example-location","Object":"example%2Ftest.flv"}

SnapshotConfig

string

Oui

Les configurations d'instantané. Pour plus d'informations, consultez SnapshotConfig.

{"OutputFile":{"Bucket":"example-001","Location":"example-location","Object":"{Count}.jpg"},"Time":"5","Num":"10","Interval":"20"}

UserData

string

Non

Les données personnalisées. La valeur peut contenir des lettres, des chiffres et des traits d'union (-), mais ne peut pas commencer par un caractère spécial. La valeur peut comporter jusqu'à 1 024 octets.

testid-001

PipelineId

string

Non

L'identifiant de la file d'attente MPS. Pour plus d'informations, consultez Concepts de base.

dd3dae411e704030b921e52698e5****

Éléments de réponse

Élément

Type

Description

Exemple

object

Les paramètres de réponse.

RequestId

string

L'identifiant de la requête.

19B6D8C5-A5DD-467A-B435-29D393C71E2D

SnapshotJob

object

La tâche d'instantané.

CreationTime

string

L'heure de création de la tâche.

2021-05-19T03:11:48Z

SnapshotConfig

object

La configuration de l'instantané.

Time

string

The snapshot start time. Unit: milliseconds.

5

TileOut

object

The tiling configuration.

Padding

string

The padding between images.

  • Default value: 0.

  • Unit: pixels.

0

Color

string

The background color.

  • Default value: black.

  • Valid values: color keyword or random.

Remarque

Color keywords can be specified in three formats. For example, to specify black, you can use Black, black, or #000000.

black

CellSelStep

string

The step for selecting individual images to include in the tiled output.

3

CellHeight

string

The height of an individual image in the tiled output. Defaults to the height of the output snapshot.

100

CellWidth

string

The width of an individual image in the tiled output. Defaults to the width of the output snapshot.

100

Margin

string

The width of the outer margin for the tiled image.

  • Default value: 0.

  • Unit: pixels.

5

Columns

string

The number of columns in the tiled image. Default value: 10.

10

IsKeepCellPic

string

Specifies whether to keep the individual snapshots. Valid values:

  • true: Keeps the individual snapshots.

  • false: Deletes the individual snapshots.

  • Default value: true.

false

Lines

string

The number of rows in the tiled image. Default value: 10.

10

Interval

string

The interval for capturing a sequence of snapshots.

  • The value must be greater than 0.

  • Unit: seconds.

  • Default value: 10.

20

FrameType

string

The type of frames to capture. Default value: normal. Valid values:

  • normal: normal frames.

  • intra: I-frames (keyframes).

Remarque

If this parameter is set to intra, only keyframes are captured. If a specified time point is not a keyframe, the system uses the nearest keyframe. Capturing keyframes is typically faster than capturing normal frames.

intra

Width

string

The width of the output snapshot.

8

Height

string

The height of the output snapshot.

8

OutputFile

object

The OSS configuration for the output snapshot.

RoleArn

string

The ARN of the role. Format: acs:ram::$accountID:role/$roleName.

acs:ram::1:role/testrole

Object

string

The name of the output OSS object.

test.png

Location

string

The data center of the output OSS bucket.

example-location

Bucket

string

The OSS bucket for the output file.

example

Num

string

The number of snapshots to capture in a sequence.

10

TileOutputFile

object

The OSS configuration for the output tiled image.

RoleArn

string

The ARN of the role. Format: acs:ram::$accountID:role/$roleName.

acs:ram::1:role/testrole

Object

string

The name of the output OSS object.

example.png

Location

string

The data center of the output OSS bucket.

example-location

Bucket

string

The OSS bucket for the output file.

example

TimeArray

object

TimePointList

array

An array of time points.

integer

An array of up to 100 time points, in milliseconds, at which to capture snapshots. Values can be floating-point numbers with up to two decimal places. You can submit time points in any order and include duplicates; MPS automatically sorts them. If you specify this parameter, do not use the Num, Time, or Interval parameters. Otherwise, the API returns an InvalidParameter.Ambiguity error.

[10050, 50000, 110000, 1000500, 1100500]

State

string

L'état de la tâche d'instantané. Valeurs valides :

Snapshoting

Message

string

Le message d'erreur. Ce paramètre n'est renvoyé que si la tâche échoue.

The resource operated InputFile is bad

MNSMessageResult

object

Le résultat de la notification MNS envoyée à l'utilisateur à la fin de la tâche.

MessageId

string

The ID of the MNS message. This parameter is returned only on successful notification.

799454621135656C7F815F198A76****

ErrorMessage

string

The error message, returned only if the MNS notification fails.

The resource operated InputFile is bad

ErrorCode

string

The error code, returned only if the MNS notification fails.

InvalidParameter

Input

object

L'entrée de la tâche.

RoleArn

string

The ARN of the role. Format: acs:ram::$accountID:role/$roleName.

acs:ram::1:role/testrole

Object

string

The name of the input OSS object.

example.flv

Location

string

The data center of the input OSS bucket.

example-location'

Bucket

string

The OSS bucket that contains the input file.

example

Count

string

Le nombre total d'instantanés capturés.

1

TileCount

string

Le nombre d'images en mosaïque.

5

UserData

string

Les données définies par l'utilisateur.

testid-001

Code

string

Le code d'erreur. Ce paramètre n'est renvoyé que lorsque l'état de la tâche est Fail.

ResourceContentBad

PipelineId

string

L'identifiant du pipeline.

dd3dae411e704030b921e52698e5****

Id

string

L'identifiant de la tâche d'instantané.

f4e3b9ba9f3840c39d6e288056f0****

Exemples

JSON format

{
  "RequestId": "19B6D8C5-A5DD-467A-B435-29D393C71E2D",
  "SnapshotJob": {
    "CreationTime": "2021-05-19T03:11:48Z",
    "SnapshotConfig": {
      "Time": "5",
      "TileOut": {
        "Padding": "0",
        "Color": "black",
        "CellSelStep": "3",
        "CellHeight": "100",
        "CellWidth": "100",
        "Margin": "5",
        "Columns": "10",
        "IsKeepCellPic": "false",
        "Lines": "10"
      },
      "Interval": "20",
      "FrameType": "intra",
      "Width": "8",
      "Height": "8",
      "OutputFile": {
        "RoleArn": "acs:ram::1:role/testrole",
        "Object": "test.png",
        "Location": "example-location",
        "Bucket": "example"
      },
      "Num": "10",
      "TileOutputFile": {
        "RoleArn": "acs:ram::1:role/testrole",
        "Object": "example.png",
        "Location": "example-location",
        "Bucket": "example"
      },
      "TimeArray": {
        "TimePointList": [
          0
        ]
      }
    },
    "State": "Snapshoting",
    "Message": "The resource operated InputFile is bad",
    "MNSMessageResult": {
      "MessageId": "799454621135656C7F815F198A76****",
      "ErrorMessage": "The resource operated InputFile is bad",
      "ErrorCode": "InvalidParameter"
    },
    "Input": {
      "RoleArn": "acs:ram::1:role/testrole",
      "Object": "example.flv",
      "Location": "example-location'",
      "Bucket": "example"
    },
    "Count": "1",
    "TileCount": "5",
    "UserData": "testid-001",
    "Code": "ResourceContentBad",
    "PipelineId": "dd3dae411e704030b921e52698e5****",
    "Id": "f4e3b9ba9f3840c39d6e288056f0****"
  }
}

Codes d'erreur

Consultez Codes d'erreur pour la liste complète.

Notes de version

Consultez Notes de version pour la liste complète.