Submits a media information analysis job.
Description
After you call the SubmitMediaInfoJob operation, ApsaraVideo Media Processing (MPS) analyzes the input media file and generates the analysis results. You can call the QueryMediaInfoJobList operation to query the analysis results.
QPS limit
You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | SubmitMediaInfoJob | The operation that you want to perform. Set the value to SubmitMediaInfoJob. |
| Input | String | Yes | {"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"} | The information about the input media file. The value is a JSON string. You must perform the following operations to grant MPS the permissions to access the OSS bucket in which the input media file is stored: Log on to the MPS console, choose Workflows > Media Buckets in the left-side navigation pane, and then click Add Bucket. Then, you must URL-encode the object. For example, Note The OSS bucket must reside in the region in which you use MPS. |
| UserData | String | No | testid-001 | The custom data. The custom data can contain letters, digits, and hyphens (-), and can be up to 1,024 bytes in length. It cannot start with a hyphen (-). |
| PipelineId | String | No | 88c6ca184c0e432bbf5b665e2a15**** | The ID of the MPS queue to which the analysis job is submitted. To view the ID of the MPS queue, log on to the MPS console and choose Global Settings > Pipelines in the left-side navigation pane. |
| Async | Boolean | No | true | Specifies whether to enable the asynchronous mode for the job. We recommend that you set this parameter to true. Valid values:
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| MediaInfoJob | Object | The details of the media information analysis job. |
|
| CreationTime | String | 2014-01-10T12:00:00Z | The time when the job was created. |
| State | String | Analyzing | The status of the job. Valid values:
|
| JobId | String | 23ca1d184c0e4341e5b665e2a12**** | The ID of the job. |
| UserData | String | testid-001 | The custom data. |
| Code | String | InvalidParameter.JsonObjectFormatInvalid | The error code returned if the job fails. |
| Message | String | The parameter "*" does not conform to the JSON Object specification | The error message returned if the job fails. |
| PipelineId | String | 88c6ca184c0e432bbf5b665e2a15**** | The ID of the MPS queue to which the analysis job is submitted. |
| Async | Boolean | true | Indicates whether the job is run in asynchronous mode. |
| Input | Object | The information about the input media file. |
|
| Object | String | example.flv | The name of the OSS object that is used as the input media file. |
| Location | String | example-location | The region of the OSS bucket in which the input media file is stored. |
| Bucket | String | example-bucket | The name of the OSS bucket in which the input media file is stored. |
| MNSMessageResult | Object | The details of the message that is sent to Message Service (MNS) to notify users of the job result. |
|
| MessageId | String | 16f01ad6175e4230ac42bb5182cd**** | The ID of the message that is returned if the job is successful. This parameter is not returned if the job fails. |
| ErrorMessage | String | InvalidParameter.JsonObjectFormatInvalid | The error message that is returned if the job fails. This parameter is not returned if the job is successful. |
| ErrorCode | String | The parameter \"Input\" does not conform to the JSON Object specification | The error code that is returned if the job fails. This parameter is not returned if the job is successful. |
| Properties | Object | The properties of the input media file. |
|
| Width | String | 1920 | The width of the video. Unit: pixels. |
| Height | String | 1080 | The height of the video. Unit: pixels. |
| Duration | String | 17.226000 | The total duration of the input media file. Unit: seconds. |
| Fps | String | 25 | The frame rate. |
| Bitrate | String | 1630.045 | The bitrate. Unit: Kbit/s. |
| FileFormat | String | QuickTime/MOV | The format of the input media file. |
| Streams | Object | The media streams contained in the input media file. |
|
| VideoStreamList | Array of VideoStream | The video streams. A media file can contain up to four video streams. |
|
| VideoStream | |||
| Sar | String | 1:1 | The sample aspect ratio (SAR). |
| Height | String | 1080 | The height of the video. Unit: pixels. |
| CodecTagString | String | avc1 | The tag string of the encoding format. |
| NetworkCost | Object | The network bandwidth that was consumed. |
|
| PreloadTime | String | 8 | The time consumed to preload the video. |
| AvgBitrate | String | 300.34 | The average bitrate. Unit: Kbit/s. |
| CostBandwidth | String | 10 | The maximum bandwidth that was consumed. |
| Width | String | 1920 | The width of the video. Unit: pixels. |
| Index | String | 1 | 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. |
| Timebase | String | 1/24000 | The time base. |
| AvgFPS | String | 23.976025 | The average frame rate. |
| PixFmt | String | yuv420p | The pixel format. |
| Lang | String | eng | The language. |
| CodecLongName | String | H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 | The full name of the encoding format. |
| NumFrames | String | 100 | The total number of frames. |
| Rotate | String | 90 | The rotation angle of the video. |
| Bitrate | String | 1496.46 | The bitrate. Unit: Kbit/s. |
| HasBFrames | String | 0 | 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. |
| Profile | String | High | The codec profile. |
| StartTime | String | 0.042000 | The start time. |
| Dar | String | 16:9 | 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. |
| CodecName | String | h264 | The short name of the encoding format. Valid values:
|
| Duration | String | 17.225542 | The duration. Unit: seconds. |
| Fps | String | 25 | The frame rate. |
| CodecTag | String | 0x31637661 | The tag of the encoding format. |
| CodecTimeBase | String | 1001/48000 | The codec time base. |
| Level | String | 41 | The codec level. |
| ColorRange | String | 700 | The color range. |
| ColorTransfer | String | R255 G83 B170 | The color channel. |
| ColorPrimaries | String | 700 | The level of color reconstruction. |
| AudioStreamList | Array of AudioStream | The audio streams. A media file can contain up to four audio streams. |
|
| AudioStream | |||
| Timebase | String | 1/44100 | The time base. |
| Index | String | 1 | The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams. |
| SampleFmt | String | fltp | The sampling format. |
| ChannelLayout | String | stereo | The output layout of the sound channels. |
| Lang | String | eng | The language. |
| Samplerate | String | 44100 | The sampling rate. Unit: Hz. |
| CodecLongName | String | AAC (Advanced Audio Coding) | The full name of the encoding format. |
| Channels | String | 2 | The number of sound channels. |
| NumFrames | String | 123 | The total number of frames. |
| Bitrate | String | 128.806 | The bitrate. Unit: Kbit/s. |
| CodecTagString | String | mp4a | The tag string of the encoding format. |
| StartTime | String | 0.000000 | The start time. |
| CodecName | String | aac | The short name of the encoding format. Default value: acc. Valid values:
|
| Duration | String | 17.159546 | The duration. Unit: seconds. |
| CodecTag | String | 0x6134706d | The tag of the encoding format. |
| CodecTimeBase | String | 1/44100 | The codec time base. |
| SubtitleStreamList | Array of SubtitleStream | The subtitle streams. A media file can contain up to four subtitle streams. |
|
| SubtitleStream | |||
| Timebase | String | 1/1000 | The time base. |
| Index | String | 3 | The sequence number of the subtitle stream. The value indicates the position of the subtitle stream in all subtitle streams. |
| StartTime | String | 0.000000 | The start time. |
| CodecName | String | ass | The short name of the encoding format. Valid values:
|
| Lang | String | eng | The language. |
| CodecLongName | String | ASS (Advanced SSA) subtitle | The full name of the encoding format. |
| Duration | String | 1370.116000 | The duration. Unit: seconds. |
| CodecTag | String | 0x0000 | The tag of the encoding format. |
| CodecTimeBase | String | 0/1 | The codec time base. |
| CodecTagString | String | [0][0][0][0] | The tag string of the encoding format. |
| Format | Object | The format information. |
|
| StartTime | String | 0.000000 | The start time. |
| NumPrograms | String | 0 | The total number of program streams. |
| Size | String | 3509895 | The size of the file. Unit: bytes. |
| NumStreams | String | 2 | The total number of media streams. |
| FormatLongName | String | QuickTime/MOV | The full name of the container format. |
| Duration | String | 17.226000 | The total duration of the input media file. Unit: seconds. |
| Bitrate | String | 1630.045 | The total bitrate. Unit: Kbit/s. |
| FormatName | String | mov | The short name of the container format. For more information about the parameters, see Parameter details. |
| FileSize | String | 3509895 | The size of the file. Unit: bytes. |
| RequestId | String | 62D9BE16-B7D5-550C-A482-7A0F60E09877 | The ID of the request. Note If a request error occurs, check whether the input media file is valid. If the input media file is valid but the issue persists, submit a ticket to contact Alibaba Cloud customer service. |
Examples
Sample requests
http(s)://mts.cn-hangzhou.aliyuncs.com/?Action=SubmitMediaInfoJob
&ResourceOwnerId=1
&Input={"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"}
&UserData=testid-001
&PipelineId=88c6ca184c0e432bbf5b665e2a15****
&Async=true
&<Common request parameters>
Sample success response
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<SubmitMediaInfoJobResponse>
<MediaInfoJob>
<CreationTime>2014-01-10T12:00:00Z</CreationTime>
<State>Analyzing</State>
<JobId>23ca1d184c0e4341e5b665e2a12****</JobId>
<UserData>testid-001</UserData>
<PipelineId>88c6ca184c0e432bbf5b665e2a15****</PipelineId>
<Async>true</Async>
<Input>
<Object>example.flv</Object>
<Location>example-location</Location>
<Bucket>example-bucket</Bucket>
</Input>
<MNSMessageResult>
<MessageId>16f01ad6175e4230ac42bb5182cd****</MessageId>
</MNSMessageResult>
<Properties>
<Width>1920</Width>
<Height>1080</Height>
<Duration>17.226000</Duration>
<Fps>25</Fps>
<Bitrate>1630.045</Bitrate>
<FileFormat>QuickTime/MOV</FileFormat>
<Streams>
<VideoStreamList>
<Sar>1:1</Sar>
<Height>1080</Height>
<CodecTagString>avc1</CodecTagString>
<NetworkCost>
<PreloadTime>8</PreloadTime>
<AvgBitrate>300.34</AvgBitrate>
<CostBandwidth>10</CostBandwidth>
</NetworkCost>
<Width>1920</Width>
<Index>1</Index>
<Timebase>1/24000</Timebase>
<AvgFPS>23.976025</AvgFPS>
<PixFmt>yuv420p</PixFmt>
<Lang>eng</Lang>
<CodecLongName>H.264/AVC/MPEG-4 AVC/MPEG-4 part 10</CodecLongName>
<NumFrames>100</NumFrames>
<Rotate>90</Rotate>
<Bitrate>1496.46</Bitrate>
<HasBFrames>0</HasBFrames>
<Profile>High</Profile>
<StartTime>0.042000</StartTime>
<Dar>16:9</Dar>
<CodecName>h264</CodecName>
<Duration>17.225542</Duration>
<Fps>25</Fps>
<CodecTag>0x31637661</CodecTag>
<CodecTimeBase>1001/48000</CodecTimeBase>
<Level>41</Level>
<ColorRange>700</ColorRange>
<ColorTransfer>R255 G83 B170</ColorTransfer>
<ColorPrimaries>700</ColorPrimaries>
</VideoStreamList>
<AudioStreamList>
<Timebase>1/44100</Timebase>
<Index>1</Index>
<SampleFmt>fltp</SampleFmt>
<ChannelLayout>stereo</ChannelLayout>
<Lang>eng</Lang>
<Samplerate>44100</Samplerate>
<CodecLongName>AAC (Advanced Audio Coding)</CodecLongName>
<Channels>2</Channels>
<NumFrames>123</NumFrames>
<Bitrate>128.806</Bitrate>
<CodecTagString>mp4a</CodecTagString>
<StartTime>0.000000</StartTime>
<CodecName>aac</CodecName>
<Duration>17.159546</Duration>
<CodecTag>0x6134706d</CodecTag>
<CodecTimeBase>1/44100</CodecTimeBase>
</AudioStreamList>
<SubtitleStreamList>
<Timebase>1/1000</Timebase>
<Index>3</Index>
<StartTime>0.000000</StartTime>
<CodecName>ass</CodecName>
<Lang>eng</Lang>
<CodecLongName>ASS (Advanced SSA) subtitle</CodecLongName>
<Duration>1370.116000</Duration>
<CodecTag>0x0000</CodecTag>
<CodecTimeBase>0/1</CodecTimeBase>
<CodecTagString>[0][0][0][0]</CodecTagString>
</SubtitleStreamList>
</Streams>
<Format>
<StartTime>0.000000</StartTime>
<NumPrograms>0</NumPrograms>
<Size>3509895</Size>
<NumStreams>2</NumStreams>
<FormatLongName>QuickTime/MOV</FormatLongName>
<Duration>17.226000</Duration>
<Bitrate>1630.045</Bitrate>
<FormatName>mov</FormatName>
</Format>
<FileSize>3509895</FileSize>
</Properties>
</MediaInfoJob>
<RequestId>62D9BE16-B7D5-550C-A482-7A0F60E09877</RequestId>
</SubmitMediaInfoJobResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"MediaInfoJob": {
"CreationTime": "2014-01-10T12:00:00Z",
"State": "Analyzing",
"JobId": "23ca1d184c0e4341e5b665e2a12****",
"UserData": "testid-001",
"PipelineId": "88c6ca184c0e432bbf5b665e2a15****",
"Async": true,
"Input": {
"Object": "example.flv",
"Location": "example-location",
"Bucket": "example-bucket"
},
"MNSMessageResult": {
"MessageId": "16f01ad6175e4230ac42bb5182cd****",
},
"Properties": {
"Width": "1920",
"Height": "1080",
"Duration": "17.226000",
"Fps": "25",
"Bitrate": "1630.045",
"FileFormat": "QuickTime/MOV",
"Streams": {
"VideoStreamList": [
{
"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"
}
],
"AudioStreamList": [
{
"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"
}
],
"SubtitleStreamList": [
{
"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"
},
"FileSize": "3509895"
}
},
"RequestId": "62D9BE16-B7D5-550C-A482-7A0F60E09877"
}
Error codes
For a list of error codes, see Service error codes.