Mengirimkan tugas analisis informasi media. Setelah Anda memanggil operasi ini, ApsaraVideo Media Processing (MPS) menganalisis informasi media file input dan mengembalikan hasilnya.
Deskripsi operasi
-
Pastikan file telah diunggah ke OSS sebelum Anda mengirimkan tugas analisis informasi media. Jika tidak, tugas akan gagal. Anda dapat menggunakan pesan callback OSS untuk mengonfirmasi status unggahan.
-
Tugas analisis informasi media mendukung mode sinkron dan asinkron.
-
Mode asinkron tidak menjamin ketepatan waktu. Setelah Anda mengirimkan tugas, tugas tersebut masuk ke antrian MPS dan menunggu penjadwalan. Tugas mungkin belum dibuat pada saat API mengembalikan respons. Untuk mengambil hasilnya, Anda dapat melakukan polling pada operasi QueryMediaInfoJob atau mengonfigurasi notifikasi pesan MNS untuk antrian MPS. Untuk informasi lebih lanjut, lihat dan Menerima notifikasi pesan.
Batasan QPS
Kueri per detik (QPS) maksimum untuk satu pengguna adalah 50. Jika Anda melebihi batas ini, panggilan API akan dibatasi laju. Hal ini dapat memengaruhi bisnis Anda. Rencanakan panggilan API Anda dengan tepat. Untuk informasi lebih lanjut, lihat Batasan QPS.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mts:SubmitMediaInfoJob |
create |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Input |
string |
Yes |
Input tugas. Untuk informasi lebih lanjut, lihat Detail input. Catatan
|
{"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"} |
| UserData |
string |
No |
Data yang ditentukan pengguna. Anda dapat menggunakan huruf, angka, dan tanda hubung (-). Tidak boleh diawali dengan karakter khusus. Panjang maksimum: 1024 byte. |
testid-001 |
| PipelineId |
string |
No |
ID pipeline. Untuk informasi lebih lanjut, lihat Istilah.
|
88c6ca184c0e432bbf5b665e2a15**** |
| Async |
boolean |
No |
Menentukan apakah akan menjalankan tugas secara asinkron. Nilai yang valid:
|
true |
| Config |
string |
No |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter respons. |
||
| MediaInfoJob |
object |
Informasi terperinci tentang tugas analisis informasi media. |
|
| CreationTime |
string |
Waktu saat tugas dikirimkan. |
2014-01-10T12:00:00Z |
| State |
string |
Status tugas.
|
Analyzing |
| JobId |
string |
ID tugas analisis informasi media. |
23ca1d184c0e4341e5b665e2a12**** |
| UserData |
string |
Data yang ditentukan pengguna. |
testid-001 |
| Code |
string |
Kode kesalahan jika tugas gagal. |
InvalidParameter.JsonObjectFormatInvalid |
| Message |
string |
Pesan kesalahan jika tugas gagal. |
The parameter ”*” does not conform to the JSON Object specification |
| PipelineId |
string |
ID pipeline. |
88c6ca184c0e432bbf5b665e2a15**** |
| Async |
boolean |
Apakah tugas berjalan secara asinkron. |
true |
| Input |
object |
Informasi input tugas. |
|
| Object |
string |
The name of the OSS object that is used as the input media file. |
example.flv |
| Location |
string |
The region in which the OSS bucket that stores the input media file resides. |
example-location |
| Bucket |
string |
The name of the OSS bucket in which the input media file is stored. |
example-bucket |
| MNSMessageResult |
object |
Hasil notifikasi MNS untuk penyelesaian tugas. |
|
| MessageId |
string |
The ID of the message that is returned if the job is successful. This parameter is not returned if the job fails. |
16f01ad6175e4230ac42bb5182cd**** |
| ErrorMessage |
string |
The error message that is returned if the job fails. This parameter is not returned if the job is successful. |
InvalidParameter.JsonObjectFormatInvalid |
| ErrorCode |
string |
The error code that is returned if the job fails. This parameter is not returned if the job is successful. |
The parameter \"Input\" does not conform to the JSON Object specification |
| Properties |
object |
Properti file media. |
|
| Width |
string |
The width of the video. Unit: pixel. |
1920 |
| Height |
string |
The height of the video. Unit: pixel. |
1080 |
| Duration |
string |
The duration of the input media file. Unit: seconds. |
17.226000 |
| Fps |
string |
The frame rate. |
25 |
| Bitrate |
string |
The bitrate. Unit: Kbit/s. |
1630.045 |
| FileFormat |
string |
The format of the input media file. |
QuickTime/MOV |
| Streams |
object |
The media streams that are contained in the input media file. |
|
| VideoStreamList |
object |
||
| VideoStream |
array<object> |
The video streams. A media file can contain up to four video streams. |
|
|
array<object> |
The response parameters. |
||
| Sar |
string |
The sample aspect ratio (SAR). |
1:1 |
| Height |
string |
The height of the video. Unit: pixel. |
1080 |
| CodecTagString |
string |
The tag string of the encoding format. |
avc1 |
| NetworkCost |
object |
The network bandwidth that is consumed. |
|
| PreloadTime |
string |
The time consumed to preload the video. |
8 |
| AvgBitrate |
string |
The average bitrate. Unit: Kbit/s. |
300.34 |
| CostBandwidth |
string |
The maximum bandwidth that is consumed. |
10 |
| Width |
string |
The width of the video. Unit: pixel. |
1920 |
| Index |
string |
The sequence number of the video stream. The value indicates the position of the video stream in all video streams. The sequence number of the first video stream to be played can be specified in some players. Default value: 1. |
1 |
| Timebase |
string |
The time base. |
1/24000 |
| AvgFPS |
string |
The average frame rate. |
23.976025 |
| PixFmt |
string |
The pixel format. |
yuv420p |
| Lang |
string |
The language. |
eng |
| CodecLongName |
string |
The full name of the encoding format. |
H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 |
| NumFrames |
string |
The total number of frames. |
100 |
| Rotate |
string |
The rotation angle of the video. |
90 |
| Bitrate |
string |
The bitrate. Unit: Kbit/s. |
1496.46 |
| HasBFrames |
string |
Indicates whether the video stream contains bidirectional frames (B-frames). A value of 1 indicates that the video stream contains B-frames. A value of 0 indicates that the video stream does not contain B-frames. |
0 |
| Profile |
string |
The codec profile. |
High |
| StartTime |
string |
The start time of the video stream. |
0.042000 |
| Dar |
string |
The display aspect ratio (DAR). DAR is the proportional relationship between the width and the height of a video. The value is used to determine whether the video is in portrait mode or landscape mode. |
16:9 |
| CodecName |
string |
The short name of the encoding format. Valid values:
|
h264 |
| Duration |
string |
The duration of the video stream. Unit: seconds. |
17.225542 |
| Fps |
string |
The frame rate. |
25 |
| CodecTag |
string |
The tag of the encoding format. |
0x31637661 |
| CodecTimeBase |
string |
The codec time base. |
1001/48000 |
| Level |
string |
The codec level. |
41 |
| ColorRange |
string |
The color range. |
700 |
| ColorTransfer |
string |
The color channel. |
R255 G83 B170 |
| ColorPrimaries |
string |
The level of color reconstruction. |
700 |
| DurationInaccurate |
string |
||
| DolbyVision |
object |
||
| Profile |
string |
||
| Level |
string |
||
| AudioStreamList |
object |
||
| AudioStream |
array<object> |
The audio streams. A media file can contain up to four audio streams. |
|
|
object |
The response parameters. |
||
| Timebase |
string |
The time base. |
1/44100 |
| Index |
string |
The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams. |
1 |
| SampleFmt |
string |
The sampling format. |
fltp |
| ChannelLayout |
string |
The output layout of the sound channels. |
stereo |
| Lang |
string |
The language. |
eng |
| Samplerate |
string |
The sampling rate. Unit: Hz. |
44100 |
| CodecLongName |
string |
The full name of the encoding format. |
AAC (Advanced Audio Coding) |
| Channels |
string |
The number of sound channels. |
2 |
| NumFrames |
string |
The total number of frames. |
123 |
| Bitrate |
string |
The bitrate. Unit: Kbit/s. |
128.806 |
| CodecTagString |
string |
The tag string of the encoding format. |
mp4a |
| StartTime |
string |
The start time of the audio stream. |
0.000000 |
| CodecName |
string |
The short name of the encoding format. Default value: acc. Valid values:
|
aac |
| Duration |
string |
The duration of the audio stream. Unit: seconds. |
17.159546 |
| CodecTag |
string |
The tag of the encoding format. |
0x6134706d |
| CodecTimeBase |
string |
The codec time base. |
1/44100 |
| DurationInaccurate |
string |
||
| SubtitleStreamList |
object |
||
| SubtitleStream |
array<object> |
The subtitle streams. A media file can contain up to four subtitle streams. |
|
|
object |
The response parameters. |
||
| Timebase |
string |
The time base. |
1/1000 |
| Index |
string |
The sequence number of the subtitle stream. The value indicates the position of the subtitle stream in all subtitle streams. |
3 |
| StartTime |
string |
The start time of the subtitle stream. |
0.000000 |
| CodecName |
string |
The short name of the encoding format. Valid values:
|
ass |
| Lang |
string |
The language. |
eng |
| CodecLongName |
string |
The full name of the encoding format. |
ASS (Advanced SSA) subtitle |
| Duration |
string |
The duration of the audio stream. Unit: seconds. |
1370.116000 |
| CodecTag |
string |
The tag of the encoding format. |
0x0000 |
| CodecTimeBase |
string |
The codec time base. |
0/1 |
| CodecTagString |
string |
The tag string of the encoding format. |
[0][0][0][0] |
| Format |
object |
The format information. |
|
| StartTime |
string |
The start time. |
0.000000 |
| NumPrograms |
string |
The total number of program streams. |
0 |
| Size |
string |
The size of the file. Unit: bytes. |
3509895 |
| NumStreams |
string |
The total number of media streams. |
2 |
| FormatLongName |
string |
The full name of the container format. |
QuickTime/MOV |
| Duration |
string |
The duration of the input media file. Unit: seconds. |
17.226000 |
| Bitrate |
string |
The total bitrate. Unit: Kbit/s. |
1630.045 |
| FormatName |
string |
The short name of the container format. For more information about the parameters, see Parameter details. |
mov |
| Tags |
object |
||
| FileSize |
string |
The size of the file. Unit: bytes. |
3509895 |
| MD5 |
string |
||
| RequestId |
string |
ID permintaan. |
62D9BE16-B7D5-550C-A482-7A0F60E09877 |
Contoh
Respons sukses
JSONformat
{
"MediaInfoJob": {
"CreationTime": "2014-01-10T12:00:00Z",
"State": "Analyzing",
"JobId": "23ca1d184c0e4341e5b665e2a12****",
"UserData": "testid-001",
"Code": "InvalidParameter.JsonObjectFormatInvalid",
"Message": "The parameter ”*” does not conform to the JSON Object specification",
"PipelineId": "88c6ca184c0e432bbf5b665e2a15****",
"Async": true,
"Input": {
"Object": "example.flv",
"Location": "example-location",
"Bucket": "example-bucket"
},
"MNSMessageResult": {
"MessageId": "16f01ad6175e4230ac42bb5182cd****",
"ErrorMessage": "InvalidParameter.JsonObjectFormatInvalid",
"ErrorCode": "The parameter \\\"Input\\\" does not conform to the JSON Object specification"
},
"Properties": {
"Width": "1920",
"Height": "1080",
"Duration": "17.226000",
"Fps": "25",
"Bitrate": "1630.045",
"FileFormat": "QuickTime/MOV",
"Streams": {
"VideoStreamList": {
"VideoStream": [
{
"Sar": "1:1",
"Height": "1080",
"CodecTagString": "avc1",
"NetworkCost": {
"PreloadTime": "8",
"AvgBitrate": "300.34",
"CostBandwidth": "10"
},
"Width": "1920",
"Index": "1",
"Timebase": "1/24000",
"AvgFPS": "23.976025",
"PixFmt": "yuv420p",
"Lang": "eng",
"CodecLongName": "H.264/AVC/MPEG-4 AVC/MPEG-4 part 10",
"NumFrames": "100",
"Rotate": "90",
"Bitrate": "1496.46",
"HasBFrames": "0",
"Profile": "High",
"StartTime": "0.042000",
"Dar": "16:9",
"CodecName": "h264",
"Duration": "17.225542",
"Fps": "25",
"CodecTag": "0x31637661",
"CodecTimeBase": "1001/48000",
"Level": "41",
"ColorRange": "700",
"ColorTransfer": "R255 G83 B170",
"ColorPrimaries": "700",
"DurationInaccurate": "",
"DolbyVision": {
"Profile": "",
"Level": ""
}
}
]
},
"AudioStreamList": {
"AudioStream": [
{
"Timebase": "1/44100",
"Index": "1",
"SampleFmt": "fltp",
"ChannelLayout": "stereo",
"Lang": "eng",
"Samplerate": "44100",
"CodecLongName": "AAC (Advanced Audio Coding)",
"Channels": "2",
"NumFrames": "123",
"Bitrate": "128.806",
"CodecTagString": "mp4a",
"StartTime": "0.000000",
"CodecName": "aac",
"Duration": "17.159546",
"CodecTag": "0x6134706d",
"CodecTimeBase": "1/44100",
"DurationInaccurate": ""
}
]
},
"SubtitleStreamList": {
"SubtitleStream": [
{
"Timebase": "1/1000",
"Index": "3",
"StartTime": "0.000000",
"CodecName": "ass",
"Lang": "eng",
"CodecLongName": "ASS (Advanced SSA) subtitle",
"Duration": "1370.116000",
"CodecTag": "0x0000",
"CodecTimeBase": "0/1",
"CodecTagString": "[0][0][0][0]"
}
]
}
},
"Format": {
"StartTime": "0.000000",
"NumPrograms": "0",
"Size": "3509895",
"NumStreams": "2",
"FormatLongName": "QuickTime/MOV",
"Duration": "17.226000",
"Bitrate": "1630.045",
"FormatName": "mov",
"Tags": {
"test": "test",
"test2": 1
}
},
"FileSize": "3509895",
"MD5": ""
}
},
"RequestId": "62D9BE16-B7D5-550C-A482-7A0F60E09877"
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.