Envia um trabalho de análise de informações de mídia. Após chamar esta operação, o ApsaraVideo Media Processing (MPS) analisa as informações de mídia do arquivo de entrada e retorna os resultados.
Descrição da operação
-
Certifique-se de que o arquivo foi carregado no OSS antes de enviar um trabalho de análise de informações de mídia. Caso contrário, o trabalho falhará. Você pode usar mensagens de callback do OSS para confirmar o status do carregamento.
-
Os trabalhos de análise de informações de mídia suportam os modos síncrono e assíncrono.
-
O modo assíncrono não garante pontualidade. Após enviar um trabalho, ele entra na fila do MPS e aguarda o agendamento. O trabalho pode não ser criado no momento em que a API retorna uma resposta. Para recuperar o resultado, você pode consultar a operação QueryMediaInfoJob ou configurar notificações de mensagens MNS para a fila do MPS. Para obter mais informações, consulte e Receber notificações de mensagens.
Limite de QPS
O número máximo de consultas por segundo (QPS) para um único usuário é 50. Se você exceder esse limite, as chamadas de API serão limitadas. Isso pode afetar seus negócios. Planeje suas chamadas de API de acordo. Para obter mais informações, consulte Limites de QPS.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
mts:SubmitMediaInfoJob |
create |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| Input |
string |
Sim |
Entrada do trabalho. Para obter mais informações, consulte Detalhes da entrada. Nota
|
{"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"} |
| UserData |
string |
Não |
Dados definidos pelo usuário. Você pode usar letras, dígitos e hifens (-). Não pode começar com um caractere especial. Comprimento máximo: 1024 bytes. |
testid-001 |
| PipelineId |
string |
Não |
ID do pipeline. Para obter mais informações, consulte Termos.
|
88c6ca184c0e432bbf5b665e2a15**** |
| Async |
boolean |
Não |
Especifica se o trabalho deve ser executado de forma assíncrona. Valores válidos:
|
true |
| Config |
string |
Não |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Parâmetros de resposta. |
||
| MediaInfoJob |
object |
Informações detalhadas sobre o trabalho de análise de informações de mídia. |
|
| CreationTime |
string |
Hora em que o trabalho foi submetido. |
2014-01-10T12:00:00Z |
| State |
string |
Status do trabalho.
|
Analyzing |
| JobId |
string |
ID do trabalho de análise de informações de mídia. |
23ca1d184c0e4341e5b665e2a12**** |
| UserData |
string |
Dados definidos pelo usuário. |
testid-001 |
| Code |
string |
Código de erro se o trabalho falhar. |
InvalidParameter.JsonObjectFormatInvalid |
| Message |
string |
Mensagem de erro se o trabalho falhar. |
The parameter ”*” does not conform to the JSON Object specification |
| PipelineId |
string |
ID do pipeline. |
88c6ca184c0e432bbf5b665e2a15**** |
| Async |
boolean |
Indica se o trabalho é executado de forma assíncrona. |
true |
| Input |
object |
Informações de entrada do trabalho. |
|
| Object |
string |
OSS object of the input file. |
example.flv |
| Location |
string |
Region of the OSS bucket. |
example-location |
| Bucket |
string |
OSS bucket of the input file. |
example-bucket |
| MNSMessageResult |
object |
Resultado da notificação MNS para a conclusão do trabalho. |
|
| MessageId |
string |
Message ID if the job succeeds. This parameter is not returned if the job fails. |
16f01ad6175e4230ac42bb5182cd**** |
| ErrorMessage |
string |
Error message if the job fails. This parameter is not returned if the job succeeds. |
InvalidParameter.JsonObjectFormatInvalid |
| ErrorCode |
string |
Error code if the job fails. This parameter is not returned if the job succeeds. |
The parameter \"Input\" does not conform to the JSON Object specification |
| Properties |
object |
Propriedades do arquivo de mídia. |
|
| Width |
string |
Video width, in pixels (px). |
1920 |
| Height |
string |
Video height, in pixels (px). |
1080 |
| Duration |
string |
Total duration, in seconds (s). |
17.226000 |
| Fps |
string |
Frame rate. |
25 |
| Bitrate |
string |
Bitrate, in Kbps. |
1630.045 |
| FileFormat |
string |
File format. |
QuickTime/MOV |
| Streams |
object |
Stream information. |
|
| VideoStreamList |
object |
||
| VideoStream |
array<object> |
Video stream list. Maximum: 4 items. |
|
|
array<object> |
Response parameters. |
||
| Sar |
string |
Sample aspect ratio. |
1:1 |
| Height |
string |
Video height, in pixels (px). |
1080 |
| CodecTagString |
string |
Codec tag string. |
avc1 |
| NetworkCost |
object |
Network bandwidth consumption. |
|
| PreloadTime |
string |
Preload time. |
8 |
| AvgBitrate |
string |
Average bitrate, in Kbps. |
300.34 |
| CostBandwidth |
string |
Maximum bandwidth consumption. |
10 |
| Width |
string |
Video width, in pixels (px). |
1920 |
| Index |
string |
Video stream index. Identifies the position of the video stream in the media file. Some players let you specify which video stream to start playback from. Others start from index 1 by default. |
1 |
| Timebase |
string |
Time base. |
1/24000 |
| AvgFPS |
string |
Average frame rate. |
23.976025 |
| PixFmt |
string |
Pixel format. |
yuv420p |
| Lang |
string |
Language. |
eng |
| CodecLongName |
string |
Codec long name. |
H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 |
| NumFrames |
string |
Total number of frames. |
100 |
| Rotate |
string |
Video rotation angle, in degrees. |
90 |
| Bitrate |
string |
Bitrate, in Kbps. |
1496.46 |
| HasBFrames |
string |
Whether B-frames exist. 0 means no. 1 means yes. |
0 |
| Profile |
string |
Codec profile. |
High |
| StartTime |
string |
Start time. |
0.042000 |
| Dar |
string |
Display aspect ratio. Dar = video width / video height. Use this value to determine whether the video is landscape or portrait. |
16:9 |
| CodecName |
string |
Codec short name. Valid values:
|
h264 |
| Duration |
string |
Duration, in seconds (s). |
17.225542 |
| Fps |
string |
Frame rate. |
25 |
| CodecTag |
string |
Codec tag. |
0x31637661 |
| CodecTimeBase |
string |
Codec time base. |
1001/48000 |
| Level |
string |
Codec level. |
41 |
| ColorRange |
string |
Color range. |
700 |
| ColorTransfer |
string |
Color transfer. |
R255 G83 B170 |
| ColorPrimaries |
string |
Color primaries. |
700 |
| DurationInaccurate |
string |
||
| DolbyVision |
object |
||
| Profile |
string |
||
| Level |
string |
||
| AudioStreamList |
object |
||
| AudioStream |
array<object> |
Audio stream list. Maximum: 4 items. |
|
|
object |
Response parameters. |
||
| Timebase |
string |
Time base. |
1/44100 |
| Index |
string |
Audio stream index. Identifies the position of the audio stream in the media file. |
1 |
| SampleFmt |
string |
Sample format. |
fltp |
| ChannelLayout |
string |
Channel layout. |
stereo |
| Lang |
string |
Language. |
eng |
| Samplerate |
string |
Sample rate, in Hz. |
44100 |
| CodecLongName |
string |
Codec long name. |
AAC (Advanced Audio Coding) |
| Channels |
string |
Number of sound channels. |
2 |
| NumFrames |
string |
Total number of frames. |
123 |
| Bitrate |
string |
Bitrate, in Kbps. |
128.806 |
| CodecTagString |
string |
Codec tag string. |
mp4a |
| StartTime |
string |
Start time. |
0.000000 |
| CodecName |
string |
Codec short name. Default value: aac. Valid values:
|
aac |
| Duration |
string |
Duration, in seconds (s). |
17.159546 |
| CodecTag |
string |
Codec tag. |
0x6134706d |
| CodecTimeBase |
string |
Codec time base. |
1/44100 |
| DurationInaccurate |
string |
||
| SubtitleStreamList |
object |
||
| SubtitleStream |
array<object> |
Subtitle stream list. Maximum: 4 items. |
|
|
object |
Response parameters. |
||
| Timebase |
string |
Time base. |
1/1000 |
| Index |
string |
Subtitle stream index. Identifies the position of the subtitle stream in the media file. |
3 |
| StartTime |
string |
Start time. |
0.000000 |
| CodecName |
string |
Codec short name. Valid values:
|
ass |
| Lang |
string |
Language. |
eng |
| CodecLongName |
string |
Codec long name. |
ASS (Advanced SSA) subtitle |
| Duration |
string |
Duration, in seconds (s). |
1370.116000 |
| CodecTag |
string |
Codec tag. |
0x0000 |
| CodecTimeBase |
string |
Codec time base. |
0/1 |
| CodecTagString |
string |
Codec tag string. |
[0][0][0][0] |
| Format |
object |
Format information. |
|
| StartTime |
string |
Start time. |
0.000000 |
| NumPrograms |
string |
Total number of program streams. |
0 |
| Size |
string |
File size, in bytes. |
3509895 |
| NumStreams |
string |
Total number of media streams. |
2 |
| FormatLongName |
string |
Container or wrapper format long name. |
QuickTime/MOV |
| Duration |
string |
Total duration, in seconds (s). |
17.226000 |
| Bitrate |
string |
Total bitrate, in Kbps. |
1630.045 |
| FormatName |
string |
Container or wrapper format short name. For more information, see Parameter details. |
mov |
| Tags |
object |
||
| FileSize |
string |
File size, in bytes. |
3509895 |
| MD5 |
string |
||
| RequestId |
string |
ID da solicitação. |
62D9BE16-B7D5-550C-A482-7A0F60E09877 |
Exemplos
Resposta de sucesso
JSON formato
{
"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"
}
Códigos de erro
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.