调用SubmitMediaInfoJob提交媒体信息作业。
使用说明
调用本接口之后媒体处理服务会对输入文件进行媒体信息分析,返回输入文件的媒体信息。您可以通过查询媒体信息作业接口得到媒体信息分析结果。
QPS限制
本接口的单用户QPS限制为50次/秒。超过限制,API调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见QPS限制。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | SubmitMediaInfoJob | 系统规定参数,取值:SubmitMediaInfoJob。 |
Input | String | 是 | {"Bucket":"example-bucket","Location":"example-location","Object":"example%2Fexample.flv"} | 作业输入。JSON对象,需在MPS控制台>工作流管理>媒体Bucket>添加Bucket授予此Bucket媒体处理服务的权限。授权完成后,还需对Object进行UrlEncoding。UrlEncoding示例: 说明 OSS的地域需要与当前MPS所在地域保持一致。 |
UserData | String | 否 | testid-001 | 用户自定义数据。可以使用中英文、数字、中划线(-)等,不能以特殊符号开头,最大长度1024个字节。 |
PipelineId | String | 否 | 88c6ca184c0e432bbf5b665e2a15**** | 管道ID。可以通过媒体处理控制台>全局设置>管道获取。 |
Async | Boolean | 否 | true | 是否发起异步作业。取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
MediaInfoJob | Object | 媒体信息作业详细信息。 |
|
CreationTime | String | 2014-01-10T12:00:00Z | 作业添加时间。 |
State | String | Analyzing | 作业状态。
|
JobId | String | 23ca1d184c0e4341e5b665e2a12**** | 元信息分析作业ID。 |
UserData | String | testid-001 | 用户自定义数据。 |
Code | String | InvalidParameter.JsonObjectFormatInvalid | 元信息分析失败时错误码。 |
Message | String | The parameter ”*” does not conform to the JSON Object specification | 元信息分析失败时错误信息。 |
PipelineId | String | 88c6ca184c0e432bbf5b665e2a15**** | 管道ID。 |
Async | Boolean | true | 是否异步。 |
Input | Object | 作业输入信息。 |
|
Object | String | example.flv | 输入文件的OSS Object。 |
Location | String | example-location | 输入文件OSS的服务区域。 |
Bucket | String | example-bucket | 输入文件的OSS Bucket。 |
MNSMessageResult | Object | MNS通知用户作业完成的结果。 |
|
MessageId | String | 16f01ad6175e4230ac42bb5182cd**** | 成功时消息ID。如果执行失败则不返回此参数。 |
ErrorMessage | String | InvalidParameter.JsonObjectFormatInvalid | 失败时错误信息。如果执行成功则不返回此参数。 |
ErrorCode | String | The parameter \"Input\" does not conform to the JSON Object specification | 失败时错误码。如果执行成功则不返回此参数。 |
Properties | Object | 媒体文件属性。 |
|
Width | String | 1920 | 视频宽度,单位为px。 |
Height | String | 1080 | 视频高度,单位为px。 |
Duration | String | 17.226000 | 总时长,单位为秒(s)。 |
Fps | String | 25 | 帧率。 |
Bitrate | String | 1630.045 | 码率。单位为Kbps。 |
FileFormat | String | QuickTime/MOV | 文件格式。 |
Streams | Object | 流信息。 |
|
VideoStreamList | Array of VideoStream | 视频流列表。列表元素至多4个。 |
|
VideoStream | |||
Sar | String | 1:1 | 编码信号分辨率比。 |
Height | String | 1080 | 视频高度,单位为px。 |
CodecTagString | String | avc1 | 编码格式标记文本。 |
NetworkCost | Object | 网络带宽消耗。 |
|
PreloadTime | String | 8 | 预加载时间。 |
AvgBitrate | String | 300.34 | 平均码率,单位为Kbps。 |
CostBandwidth | String | 10 | 最大消耗带宽。 |
Width | String | 1920 | 视频宽度,单位为px。 |
Index | String | 1 | 视频流序号。标识视频流在整个媒体流中的位置。某些播放平台可以指定起播的视频流序号,某些默认从1号起播。 |
Timebase | String | 1/24000 | 时基。 |
AvgFPS | String | 23.976025 | 平均帧率。 |
PixFmt | String | yuv420p | 像素格式。 |
Lang | String | eng | 语言。 |
CodecLongName | String | H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 | 编码格式长述名。 |
NumFrames | String | 100 | 总帧数。 |
Rotate | String | 90 | 视频旋转角度。 |
Bitrate | String | 1496.46 | 码率,单位Kbps。 |
HasBFrames | String | 0 | 是否有B帧。0表示无,1表示有。 |
Profile | String | High | 编码预置。 |
StartTime | String | 0.042000 | 起始时间。 |
Dar | String | 16:9 | 编码显示分辨率比。Dar=视频宽度/视频高度,可以作为判断视频横竖屏的依据。 |
CodecName | String | h264 | 编码格式简述名。可选值:
|
Duration | String | 17.225542 | 时长,单位为秒(s)。 |
Fps | String | 25 | 帧率。 |
CodecTag | String | 0x31637661 | 编码格式标记。 |
CodecTimeBase | String | 1001/48000 | 编码时基。 |
Level | String | 41 | 编码等级。 |
ColorRange | String | 700 | 色彩范围。 |
ColorTransfer | String | R255 G83 B170 | 色彩通道。 |
ColorPrimaries | String | 700 | 色原。 |
AudioStreamList | Array of AudioStream | 音频流列表。列表元素至多4个。 |
|
AudioStream | |||
Timebase | String | 1/44100 | 时基。 |
Index | String | 1 | 音频流序号。标识音频流在整个媒体流中的位置。 |
SampleFmt | String | fltp | 采样格式。 |
ChannelLayout | String | stereo | 声道输出样式。 |
Lang | String | eng | 语言。 |
Samplerate | String | 44100 | 采样率,单位Hz。 |
CodecLongName | String | AAC (Advanced Audio Coding) | 编码格式长述名。 |
Channels | String | 2 | 声道数。 |
NumFrames | String | 123 | 总帧数。 |
Bitrate | String | 128.806 | 码率,单位为Kbps。 |
CodecTagString | String | mp4a | 编码格式标记文本。 |
StartTime | String | 0.000000 | 起始时间。 |
CodecName | String | aac | 编码格式简述名。默认值:acc。可取值:
|
Duration | String | 17.159546 | 时长,单位为秒(s)。 |
CodecTag | String | 0x6134706d | 编码格式标记。 |
CodecTimeBase | String | 1/44100 | 编码时基。 |
SubtitleStreamList | Array of SubtitleStream | 字幕流列表。列表元素至多4个。 |
|
SubtitleStream | |||
Timebase | String | 1/1000 | 时基。 |
Index | String | 3 | 字幕流序号。标识字幕流在整个媒体流中的位置。 |
StartTime | String | 0.000000 | 起始时间。 |
CodecName | String | ass | 编码格式简述名。可选值:
|
Lang | String | eng | 语言。 |
CodecLongName | String | ASS (Advanced SSA) subtitle | 编码格式长述名。 |
Duration | String | 1370.116000 | 时长,单位为秒(s)。 |
CodecTag | String | 0x0000 | 编码格式标记。 |
CodecTimeBase | String | 0/1 | 编码时基。 |
CodecTagString | String | [0][0][0][0] | 编码格式标记文本。 |
Format | Object | 格式信息。 |
|
StartTime | String | 0.000000 | 起始时间。 |
NumPrograms | String | 0 | 节目流总数。 |
Size | String | 3509895 | 文件大小,单位为字节(byte)。 |
NumStreams | String | 2 | 媒体流总数。 |
FormatLongName | String | QuickTime/MOV | 容器、封装格式长述名。 |
Duration | String | 17.226000 | 总时长,单位为秒(s)。 |
Bitrate | String | 1630.045 | 总码率,单位为Kbps。 |
FormatName | String | mov | 容器、封装格式简述名。更多参数信息请参见参数详情。 |
FileSize | String | 3509895 | 文件大小,单位为字节(byte)。 |
RequestId | String | 62D9BE16-B7D5-550C-A482-7A0F60E09877 | 请求ID。 |
示例
请求示例
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
&<公共请求参数>
正常返回示例
XML
格式
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
格式
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"
}
错误码
访问错误中心查看更多错误码。