调用QueryMediaListByURL使用OSS文件地址查询媒体。
使用说明
- 本接口一次最多查询10个媒体文件。
- 调用本接口前,请先调用新增媒体接口新增媒体文件,再调用本接口查询媒体信息。
- 本接口仅支持查询工作流处理的文件信息。新上传的媒体文件,需要工作流执行完成后,通过本接口获取的文件信息才会完整。非工作流处理任务要想获得视频数据信息,需要调用SubmitMediaInfoJob处理媒体信息作业之后方可查看。
QPS限制
本接口的单用户QPS限制为100次/秒。超过限制,API调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见QPS限制。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | QueryMediaListByURL | 操作接口名,系统规定参数。取值:QueryMediaListByURL。 |
| FileURLs | String | 是 | http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/example.mp4 | 需要查询的媒体文件地址,可以登录MPS控制台,通过媒体管理 > 媒体列表找到需要查询的媒体文件,单击操作列管理,在获取转码地址页签中获取媒体文件地址。用半角逗号(,)分隔,一次最多查询10个。
|
| IncludePlayList | Boolean | 否 | true | 返回结果中是否包含播放信息。
|
| IncludeSnapshotList | Boolean | 否 | true | 返回结果中是否包含截图信息。
|
| IncludeMediaInfo | Boolean | 否 | true | 返回结果中是否包含媒体信息。
|
| IncludeSummaryList | Boolean | 否 | true | 返回结果中是否包含摘要列表。
|
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| MediaList | Array of Media | 媒体列表。 |
|
| Media | |||
| CreationTime | String | 2021-07-14T13:05:00Z | 创建时间。 |
| CateId | Long | 123 | 类目ID。 |
| Height | String | 360 | 查询到的媒体文件的高。 |
| CensorState | String | Initiated | 视频审核状态。取值:
|
| Tags | Array of String | tag1,tag2 | 标签列表。 |
| PlayList | Array of Play | 播放列表。 |
|
| Play | |||
| Encryption | String | 1 | 加密。取值:
|
| Height | String | 10 | 高。 |
| Bitrate | String | 25.067 | 码率。 |
| File | Object | 播放文件。 |
|
| State | String | Normal | 文件状态。取值范围:
|
| URL | String | http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4l-test/in/1.mp4 | 播放文件的输入OSS Bucket。 |
| MediaWorkflowId | String | 6cc3aa66d1cb4bb2adf14e726c0a**** | 产生播放文件的工作流ID。 |
| Width | String | 11 | 宽。 |
| Size | String | 100 | 大小。 |
| Fps | String | 25.0 | 帧率。 |
| Duration | String | 7.965000 | 时长。 |
| ActivityName | String | test name | 媒体工作流活动名称。 |
| Format | String | mov | 编码格式。支持mov、mp4、m4a、3gp、3g2、mj2。 |
| MediaWorkflowName | String | example-mediaworkflow-**** | 产生播放文件的工作流。 |
| Bitrate | String | 593.192 | 码率。 |
| MediaId | String | 52d7e98b05e648199612290bb819**** | 媒体ID。 |
| File | Object | 输入文件详细信息。 |
|
| State | String | Normal | 文件状态。取值范围:
|
| URL | String | http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4 | 输入文件的OSS Bucket。 |
| SummaryList | Array of Summary | 视频摘要列表。 |
|
| Summary | |||
| Type | String | Gif | 摘要类型。取值范围:
|
| MediaWorkflowId | String | 93ab850b4f6f44eab54b6e91d24d**** | 产生摘要的工作流ID。 |
| ActivityName | String | example-activity-**** | 媒体工作流活动名称。 |
| MediaWorkflowName | String | example-mediaworkflow-**** | 产生摘要的工作流。 |
| File | Object | 原文件。 |
|
| State | String | Normal | 文件状态。取值范围:
|
| URL | String | http://example-bucket-****.o | 输入文件的OSS Bucket。 |
| PublishState | String | Published | 媒体发布状态,表示是否对外发布媒体。取值范围:
|
| MediaInfo | Object | 媒体信息。 |
|
| Streams | Object | 流信息。 |
|
| VideoStreamList | Array of VideoStream | 视频流列表。 |
|
| VideoStream | |||
| Sar | String | 1:1 | 编码信号分辨率比。 |
| Height | String | 360 | 视频分辨率高。 |
| CodecTagString | String | avc1 | 编码格式标记文本。 |
| NetworkCost | Object | 网络带宽消耗。 |
|
| PreloadTime | String | 0.01 | 预加载时间。 |
| AvgBitrate | String | 2659.326 | 平均码率。 |
| CostBandwidth | String | 100 | 最大消耗带宽。 |
| Width | String | 640 | 视频分辨率宽,数字,不能为负数。 |
| Index | String | 5 | 视频流序号,标识视频流在整个媒体流中的位置。 |
| Timebase | String | 1/15360 | 时基。 |
| AvgFPS | String | 15.0 | 平均帧率。 |
| PixFmt | String | yuv420p | 像素格式。 |
| Lang | String | und | 语言。更多信息,请参见FFmpeg语言定义。 |
| CodecLongName | String | H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 | 编码格式长述名。 |
| NumFrames | String | 12 | 总帧数。 |
| Rotate | String | 90 | 视频旋转角度。 |
| Bitrate | String | 512.701 | 码率。 |
| HasBFrames | String | 2 | 是否有B帧。1表示有,2表示没有。 |
| Profile | String | High | 编码预置。 |
| StartTime | String | 0.046029 | 起始时间。 |
| Dar | String | 16:9 | 编码显示分辨率比。 |
| CodecName | String | H264 | 编码格式简述名。支持H264、mov、aac、avc、mpeg。 |
| Duration | String | 79.200000 | 时长。 |
| Fps | String | 15.0 | 帧率。 |
| CodecTag | String | 0x31637661 | 编码格式标记。 |
| CodecTimeBase | String | 1/30 | 编码时基。 |
| Level | String | 31 | 编码等级。 |
| AudioStreamList | Array of AudioStream | 音频流列表。 |
|
| AudioStream | |||
| Timebase | String | 1/44100 | 时基。 |
| Index | String | 1 | 音频流序号,标识音频流在整个媒体流中的位置。 |
| SampleFmt | String | fltp | 采样格式。 |
| ChannelLayout | String | stereo | 声道输出样式。 |
| Lang | String | und | 语言。参考FFmpeg语言定义。 |
| Samplerate | String | 44100 | 采样率。 |
| CodecLongName | String | AAC (Advanced Audio Coding) | 编码格式长述名。 |
| Channels | String | 2 | 声道数。 |
| NumFrames | String | 100 | 总帧数。 |
| Bitrate | String | 76.356 | 码率。 |
| CodecTagString | String | mp4a | 编码格式标记文本。 |
| StartTime | String | 0.000000 | 起始时间。 |
| CodecName | String | aac | 编码格式简述名。支持H264、mov、aac、avc、mpeg。 |
| Duration | String | 79.203265 | 时长。 |
| CodecTag | String | 0x6134706d | 编码格式标记。 |
| CodecTimeBase | String | 1/44100 | 编码时基。 |
| SubtitleStreamList | Array of SubtitleStream | 字幕流列表。 |
|
| SubtitleStream | |||
| Index | String | 1 | 字幕流序号,标识字幕流在整个媒体流中的位置。 |
| Lang | String | und | 语言。参考FFmpeg语言定义。 |
| Format | Object | 格式信息。 |
|
| StartTime | String | 0.000000 | 开始时间。 |
| NumPrograms | String | 0 | 节目流总数。 |
| Size | String | 5872904 | 大小。 |
| NumStreams | String | 2 | 媒体流总数。 |
| FormatLongName | String | QuickTime/MOV | 编码格式长述名。 |
| Duration | String | 79.204000 | 时长。 |
| Bitrate | String | 593.192 | 码率。 |
| FormatName | String | mov | 容器/封装格式简述名,支持mov,mp4,m4a,3gp,3g2,mj2。 |
| Description | String | This is description **** | 描述。 |
| Size | String | 5872904 | 文件大小。 |
| Width | String | 640 | 宽。 |
| CoverURL | String | http://example-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example-****.png | 封面的OSS Bucket。 |
| SnapshotList | Array of Snapshot | 截图列表。 |
|
| Snapshot | |||
| Type | String | Single | 截图类型。取值范围:
|
| MediaWorkflowId | String | 6cc3aa66d1cb4bb2adf14e726c0a**** | 产生截图文件的工作流ID。 |
| ActivityName | String | example-activity1-**** | 产生截图文件的工作流活动名称。 |
| Count | String | 3 | 截图张数。此值只在Type为Sequence时有意义。 |
| MediaWorkflowName | String | example-workflow-**** | 产生截图文件的工作流。 |
| File | Object | 截图文件。 |
|
| State | String | Normal | 文件状态。取值范围:
|
| URL | String | http://example1-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example111-****.png | 截图文件的OSS Bucket。 |
| RunIdList | Array of String | 9343bd0e7bb54ae19228529908e5**** | 媒体工作流ID列表。 |
| Duration | String | 79.204000 | 时长。 |
| Fps | String | 15.0 | 帧率。 |
| Title | String | kled.mp4 | 标题。 |
| Format | String | mov | 编码格式。支持mov,mp4,m4a,3gp,3g2,mj2。 |
| NonExistFileURLs | Array of String | null | 不存在的媒体ID,无数据时此参数不返回。 |
| RequestId | String | 1C8A0AEB-4321-485B-B4CB-DA4E9E6C9B42 | 请求ID。 |
示例
请求示例
http(s)://mts.cn-hangzhou.aliyuncs.com/?Action=QueryMediaListByURL
&FileURLs=http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/example.mp4
&IncludePlayList=true
&IncludeSnapshotList=true
&IncludeMediaInfo=true
&IncludeSummaryList=true
&<公共请求参数>
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<QueryMediaListByURLResponse>
<MediaList>
<CreationTime>2021-07-14T13:05:00Z</CreationTime>
<CateId>123</CateId>
<Height>360</Height>
<CensorState>Initiated</CensorState>
<Tags>tag1,tag2</Tags>
<PlayList>
<Encryption>1</Encryption>
<Height>10</Height>
<Bitrate>25.067</Bitrate>
<File>
<State>Normal</State>
<URL>http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4l-test/in/1.mp4</URL>
</File>
<MediaWorkflowId>6cc3aa66d1cb4bb2adf14e726c0a****</MediaWorkflowId>
<Width>11</Width>
<Size>100</Size>
<Fps>25.0</Fps>
<Duration>7.965000</Duration>
<ActivityName>test name</ActivityName>
<Format>mov</Format>
<MediaWorkflowName>example-mediaworkflow-****</MediaWorkflowName>
</PlayList>
<Bitrate>593.192</Bitrate>
<MediaId>52d7e98b05e648199612290bb819****</MediaId>
<File>
<State>Normal</State>
<URL>http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4</URL>
</File>
<SummaryList>
<Type>Gif</Type>
<MediaWorkflowId>93ab850b4f6f44eab54b6e91d24d****</MediaWorkflowId>
<ActivityName>example-activity-****</ActivityName>
<MediaWorkflowName>example-mediaworkflow-****</MediaWorkflowName>
<File>
<State>Normal</State>
<URL>http://example-bucket-****.o</URL>
</File>
</SummaryList>
<PublishState>Published</PublishState>
<MediaInfo>
<Streams>
<VideoStreamList>
<Sar>1:1</Sar>
<Height>360</Height>
<CodecTagString>avc1</CodecTagString>
<NetworkCost>
<PreloadTime>0.01</PreloadTime>
<AvgBitrate>2659.326</AvgBitrate>
<CostBandwidth>100</CostBandwidth>
</NetworkCost>
<Width>640</Width>
<Index>5</Index>
<Timebase>1/15360</Timebase>
<AvgFPS>15.0</AvgFPS>
<PixFmt>yuv420p</PixFmt>
<Lang>und</Lang>
<CodecLongName>H.264/AVC/MPEG-4 AVC/MPEG-4 part 10</CodecLongName>
<NumFrames>12</NumFrames>
<Rotate>90</Rotate>
<Bitrate>512.701</Bitrate>
<HasBFrames>2</HasBFrames>
<Profile>High</Profile>
<StartTime>0.046029</StartTime>
<Dar>16:9</Dar>
<CodecName>H264</CodecName>
<Duration>79.200000</Duration>
<Fps>15.0</Fps>
<CodecTag>0x31637661</CodecTag>
<CodecTimeBase>1/30</CodecTimeBase>
<Level>31</Level>
</VideoStreamList>
<AudioStreamList>
<Timebase>1/44100</Timebase>
<Index>1</Index>
<SampleFmt>fltp</SampleFmt>
<ChannelLayout>stereo</ChannelLayout>
<Lang>und</Lang>
<Samplerate>44100</Samplerate>
<CodecLongName>AAC (Advanced Audio Coding)</CodecLongName>
<Channels>2</Channels>
<NumFrames>100</NumFrames>
<Bitrate>76.356</Bitrate>
<CodecTagString>mp4a</CodecTagString>
<StartTime>0.000000</StartTime>
<CodecName>aac</CodecName>
<Duration>79.203265</Duration>
<CodecTag>0x6134706d</CodecTag>
<CodecTimeBase>1/44100</CodecTimeBase>
</AudioStreamList>
<SubtitleStreamList>
<Index>1</Index>
<Lang>und</Lang>
</SubtitleStreamList>
</Streams>
<Format>
<StartTime>0.000000</StartTime>
<NumPrograms>0</NumPrograms>
<Size>5872904</Size>
<NumStreams>2</NumStreams>
<FormatLongName>QuickTime/MOV</FormatLongName>
<Duration>79.204000</Duration>
<Bitrate>593.192</Bitrate>
<FormatName>mov</FormatName>
</Format>
</MediaInfo>
<Description>This is description ****</Description>
<Size>5872904</Size>
<Width>640</Width>
<CoverURL>http://example-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example-****.png</CoverURL>
<SnapshotList>
<Type>Single</Type>
<MediaWorkflowId>6cc3aa66d1cb4bb2adf14e726c0a****</MediaWorkflowId>
<ActivityName>example-activity1-****</ActivityName>
<Count>3</Count>
<MediaWorkflowName>example-workflow-****</MediaWorkflowName>
<File>
<State>Normal</State>
<URL>http://example1-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example111-****.png</URL>
</File>
</SnapshotList>
<RunIdList>9343bd0e7bb54ae19228529908e5****</RunIdList>
<Duration>79.204000</Duration>
<Fps>15.0</Fps>
<Title>kled.mp4</Title>
<Format>mov</Format>
</MediaList>
<NonExistFileURLs>null</NonExistFileURLs>
<RequestId>1C8A0AEB-4321-485B-B4CB-DA4E9E6C9B42</RequestId>
</QueryMediaListByURLResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"MediaList" : [ {
"CreationTime" : "2021-07-14T13:05:00Z",
"CateId" : 123,
"Height" : "360",
"CensorState" : "Initiated",
"Tags" : [ "tag1,tag2" ],
"PlayList" : [ {
"Encryption" : "1",
"Height" : "10",
"Bitrate" : "25.067",
"File" : {
"State" : "Normal",
"URL" : "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4l-test/in/1.mp4"
},
"MediaWorkflowId" : "6cc3aa66d1cb4bb2adf14e726c0a****",
"Width" : "11",
"Size" : "100",
"Fps" : "25.0",
"Duration" : "7.965000",
"ActivityName" : "test name",
"Format" : "mov",
"MediaWorkflowName" : "example-mediaworkflow-****"
} ],
"Bitrate" : "593.192",
"MediaId" : "52d7e98b05e648199612290bb819****",
"File" : {
"State" : "Normal",
"URL" : "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4"
},
"SummaryList" : [ {
"Type" : "Gif",
"MediaWorkflowId" : "93ab850b4f6f44eab54b6e91d24d****",
"ActivityName" : "example-activity-****",
"MediaWorkflowName" : "example-mediaworkflow-****",
"File" : {
"State" : "Normal",
"URL" : "http://example-bucket-****.o"
}
} ],
"PublishState" : "Published",
"MediaInfo" : {
"Streams" : {
"VideoStreamList" : [ {
"Sar" : "1:1",
"Height" : "360",
"CodecTagString" : "avc1",
"NetworkCost" : {
"PreloadTime" : "0.01",
"AvgBitrate" : "2659.326",
"CostBandwidth" : "100"
},
"Width" : "640",
"Index" : "5",
"Timebase" : "1/15360",
"AvgFPS" : "15.0",
"PixFmt" : "yuv420p",
"Lang" : "und",
"CodecLongName" : "H.264/AVC/MPEG-4 AVC/MPEG-4 part 10",
"NumFrames" : "12",
"Rotate" : "90",
"Bitrate" : "512.701",
"HasBFrames" : "2",
"Profile" : "High",
"StartTime" : "0.046029",
"Dar" : "16:9",
"CodecName" : "H264",
"Duration" : "79.200000",
"Fps" : "15.0",
"CodecTag" : "0x31637661",
"CodecTimeBase" : "1/30",
"Level" : "31"
} ],
"AudioStreamList" : [ {
"Timebase" : "1/44100",
"Index" : "1",
"SampleFmt" : "fltp",
"ChannelLayout" : "stereo",
"Lang" : "und",
"Samplerate" : "44100",
"CodecLongName" : "AAC (Advanced Audio Coding)",
"Channels" : "2",
"NumFrames" : "100",
"Bitrate" : "76.356",
"CodecTagString" : "mp4a",
"StartTime" : "0.000000",
"CodecName" : "aac",
"Duration" : "79.203265",
"CodecTag" : "0x6134706d",
"CodecTimeBase" : "1/44100"
} ],
"SubtitleStreamList" : [ {
"Index" : "1",
"Lang" : "und"
} ]
},
"Format" : {
"StartTime" : "0.000000",
"NumPrograms" : "0",
"Size" : "5872904",
"NumStreams" : "2",
"FormatLongName" : "QuickTime/MOV",
"Duration" : "79.204000",
"Bitrate" : "593.192",
"FormatName" : "mov"
}
},
"Description" : "This is description ****",
"Size" : "5872904",
"Width" : "640",
"CoverURL" : "http://example-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example-****.png",
"SnapshotList" : [ {
"Type" : "Single",
"MediaWorkflowId" : "6cc3aa66d1cb4bb2adf14e726c0a****",
"ActivityName" : "example-activity1-****",
"Count" : "3",
"MediaWorkflowName" : "example-workflow-****",
"File" : {
"State" : "Normal",
"URL" : "http://example1-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example111-****.png"
}
} ],
"RunIdList" : [ "9343bd0e7bb54ae19228529908e5****" ],
"Duration" : "79.204000",
"Fps" : "15.0",
"Title" : "kled.mp4",
"Format" : "mov"
} ],
"NonExistFileURLs" : [ "null" ],
"RequestId" : "1C8A0AEB-4321-485B-B4CB-DA4E9E6C9B42"
}
错误码
访问错误中心查看更多错误码。