Mengirimkan Pekerjaan Snapshot. Layanan Media Processing Service (MPS) kemudian mengambil tangkapan layar dan menghasilkan gambar Sprite dari file input.
Deskripsi operasi
-
The maximum size for a single input file is 100 GB. Exceeding this limit may cause the job to fail.
-
Before you submit a snapshot job, ensure the file has been successfully uploaded to OSS. Otherwise, the job may fail. You can configure OSS callbacks to confirm the file upload status.
-
Snapshot jobs support both synchronous and asynchronous modes.
-
Synchronous mode supports only a single snapshot and generates the image when the API call returns.
-
Asynchronous mode does not guarantee immediate processing. After you submit a snapshot job, it enters a pipeline, where it is queued and scheduled for execution. Therefore, the snapshot is not guaranteed to be generated when the API call returns. After the job is complete, you can poll for the results by calling the Query snapshot job results API or receive message notifications by binding MNS to the pipeline. For more information, see Receive message notifications.
-
Specifying either the Interval or Num parameter triggers asynchronous mode.
-
-
Currently, only images in JPG format are supported.
-
For more information about common snapshot issues, see Snapshot FAQ.
QPS limit
The QPS limit for this API is 50 requests per second per user. API calls that exceed this limit are subject to throttling, which may impact your business. Please call this API at a reasonable rate. For more information, see QPS limit.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mts:SubmitSnapshotJob |
create |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Input |
string |
Yes |
Input Pekerjaan. Untuk informasi selengkapnya, lihat Input. Catatan
|
{"Bucket":"example-bucket","Location":"example-location","Object":"example%2Ftest.flv"} |
| SnapshotConfig |
string |
Yes |
Konfigurasi Snapshot. Untuk informasi selengkapnya, lihat SnapshotConfig. |
{"OutputFile":{"Bucket":"example-001","Location":"example-location","Object":"{Count}.jpg"},"Time":"5","Num":"10","Interval":"20"} |
| UserData |
string |
No |
Data kustom. Nilai dapat berisi huruf, angka, dan tanda hubung (-), tetapi tidak dapat diawali dengan karakter khusus. Panjang nilai dapat mencapai 1.024 byte. |
testid-001 |
| PipelineId |
string |
No |
ID Antrian MPS. Untuk informasi selengkapnya, lihat Konsep dasar.
|
dd3dae411e704030b921e52698e5**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
19B6D8C5-A5DD-467A-B435-29D393C71E2D |
| SnapshotJob |
object |
The snapshot job. |
|
| CreationTime |
string |
The time the job was created. |
2021-05-19T03:11:48Z |
| SnapshotConfig |
object |
The snapshot configuration. |
|
| Time |
string |
The start time for capturing snapshots. Unit: milliseconds. |
5 |
| TileOut |
object |
The tiling configurations. |
|
| Padding |
string |
The distance between two consecutive single images in the tiled image.
|
0 |
| Color |
string |
The background color.
Catatan
If you want to set the background color to black, you can specify the color keyword in one of the following three formats: Black, black, and #000000. |
black |
| CellSelStep |
string |
The step for selecting a single image. |
3 |
| CellHeight |
string |
The height of a single image. The default value is the height of the output snapshot. |
100 |
| CellWidth |
string |
The width of a single image. The default value is the width of the output snapshot. |
100 |
| Margin |
string |
The margin width of the tiled image.
|
5 |
| Columns |
string |
The number of columns that the tiled image contains. Default value: 10. |
10 |
| IsKeepCellPic |
string |
Indicates whether the single images are retained. Valid values:
|
false |
| Lines |
string |
The number of rows that the tiled image contains. Default value: 10. |
10 |
| Interval |
string |
The interval for capturing snapshots.
|
20 |
| FrameType |
string |
The type of the snapshot. Default value: Normal. Valid values:
Catatan
If the FrameType parameter is set to intra in the request, only keyframes are captured. If no keyframe is found at the specified point in time, the keyframe closest to the specified point in time is captured. Keyframes are captured faster than normal frames if the same snapshot rules are applied. |
intra |
| Width |
string |
The width of the output snapshot. |
8 |
| Height |
string |
The height of the output snapshot. |
8 |
| OutputFile |
object |
The information about the output file of the snapshot job. |
|
| RoleArn |
string |
The Alibaba Cloud Resource Name (ARN) of the specified RAM role. Format: acs:ram::$accountID:role/$roleName. |
acs:ram::1:role/testrole |
| Object |
string |
The OSS object that is generated as the output file of the snapshot job. |
test.png |
| Location |
string |
The OSS region in which the OSS bucket for storing the output snapshot resides. |
example-location |
| Bucket |
string |
The OSS bucket that stores the output snapshot. |
example |
| Num |
string |
The number of snapshots. If the Num parameter is set in the request, snapshots are captured at intervals. |
10 |
| TileOutputFile |
object |
The information about the output file of the tiling job. |
|
| RoleArn |
string |
The ARN of the specified RAM role. Format: acs:ram::$accountID:role/$roleName. |
acs:ram::1:role/testrole |
| Object |
string |
The OSS object that is generated as the output file of the tiling job. |
example.png |
| Location |
string |
The ID of the region in which the OSS bucket that stores the object is located. |
example-location |
| Bucket |
string |
The OSS bucket that stores the object. |
example |
| TimeArray |
object |
||
| TimePointList |
array |
An array of specified time points. |
|
|
integer |
An array of specified time points. The unit is milliseconds, represented as a floating-point number with two decimal places. Values can be duplicated and submitted in any order; MPS will perform sorting. A maximum of 100 time points is allowed. When this parameter is specified, none of the parameters Num, Time, or Interval should be specified. If any of them are specified, the system returns an error: InvalidParameter.Ambiguity. |
[10050, 50000, 110000, 1000500, 1100500] |
|
| State |
string |
The state of the snapshot job. Valid values:
|
Snapshoting |
| Message |
string |
The error message. This parameter is returned only if the job fails. |
The resource operated InputFile is bad |
| MNSMessageResult |
object |
The result of the MNS notification sent to the user upon job completion. |
|
| MessageId |
string |
The ID of the message. This parameter is not returned if the job fails. |
799454621135656C7F815F198A76**** |
| ErrorMessage |
string |
The error message returned if the job fails. This parameter is not returned if the job is successful. |
The resource operated InputFile is bad |
| ErrorCode |
string |
The error code returned if the job fails. This parameter is not returned if the job is successful. |
InvalidParameter |
| Input |
object |
The job input. |
|
| RoleArn |
string |
The ARN of the specified RAM role. Format: acs:ram::$accountID:role/$roleName. |
acs:ram::1:role/testrole |
| Object |
string |
The OSS object that is used as the input file. |
example.flv |
| Location |
string |
The region in which the OSS bucket resides. |
example-location' |
| Bucket |
string |
The OSS bucket that stores the object. |
example |
| Count |
string |
The total number of captured snapshots. |
1 |
| TileCount |
string |
The number of tiled images. |
5 |
| UserData |
string |
The user-defined data. |
testid-001 |
| Code |
string |
The error code. This parameter is returned only when the job status is Fail. |
ResourceContentBad |
| PipelineId |
string |
The pipeline ID. |
dd3dae411e704030b921e52698e5**** |
| Id |
string |
The ID of the snapshot job. |
f4e3b9ba9f3840c39d6e288056f0**** |
Contoh
Respons sukses
JSONformat
{
"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****"
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.