搜索媒体信息

最近更新时间:2024-04-03 11:31:55

我的收藏

1. 接口描述

接口请求域名: vod.tencentcloudapi.com 。

搜索媒体信息,支持多种条件筛选,以及支持对返回结果排序、过滤等功能,具体包括:

  • 指定文件 ID 集合 FileIds ,返回匹配集合中任意 ID 的媒体。

  • 根据多个媒体文件名 Names 或描述信息 Descriptions 进行模糊搜索。

  • 根据多个文件名前缀 NamePrefixes 进行搜索。

  • 指定分类集合 ClassIds(见输入参数),返回满足集合中任意分类的媒体。例如:媒体分类有电影、电视剧、综艺等,其中电影分类下又有子分类历史片、动作片、言情片。如果 ClassIds 指定了电影、电视剧,那么电影和电视剧下的所有子分类都会返回;而如果 ClassIds 指定的是历史片、动作片,那么只有这2个子分类下的媒体才会返回。

  • 指定标签集合 Tags(见输入参数),返回满足集合中任意标签的媒体。例如:媒体标签有二次元、宫斗、鬼畜,如果 Tags 指定了二次元、鬼畜2个标签,那么只要符合这2个标签中任意一个的媒体都会被检索出来。

  • 指定文件类型集合 Categories(见输入参数),返回满足集合中任意类型的媒体。例如:文件类型有 Video(视频)、 Audio (音频)、 Image (图片)。如果Categories指定了 Video 和 Audio 2个文件类型,那么符合这些类型的媒体都会被检索出来。

  • 指定来源集合 SourceTypes(见输入参数),返回满足集合中任意来源的媒体。例如:媒体来源有 Record (直播录制)、Upload (上传)等。如果 SourceTypes 指定了 Record 和 Upload ,那么符合这些来源的媒体都会被检索出来。

  • 指定文件封装格式集合 MediaTypes(见输入参数),返回满足集合中任意封装格式的媒体。例如:封装格式有 MP4、AVI、MP3 等。如果 MediaTypes 指定了 MP4 和 MP3,那么符合这些封装格式的媒体都会被检索出来。

  • 指定文件状态集合 Status(见输入参数),返回满足集合中任意状态的媒体。例如:文件状态有 Normal(正常)、SystemForbidden(平台封禁)、Forbidden(主动封禁)。如果 Status 指定了 Normal 和 Forbidden 2种文件状态,那么符合这些状态的媒体都会被检索出来。

  • 指定文件审核结果集合 ReviewResults(见输入参数),返回满足集合中任意状态的媒体。例如:文件审核结果有 pass(通过)、block(违规)等。如果 ReviewResults 指定了 pass 和 block 2种审核结果,那么符合这些审核结果的媒体都会被检索出来。

  • 指定直播推流码集合 StreamIds(见输入参数)筛选直播录制的媒体。

  • 指定媒体的创建时间范围筛选媒体。

  • 指定 TRTC 应用 ID 集合筛选媒体。

  • 指定 TRTC 房间 ID 集合筛选媒体。

  • 以上参数之间可以任意组合进行检索。例如:筛选创建时间在2018年12月1日12:00:00到2018年12月8日12:00:00之间、分类为电影或电视剧、带有宫斗和悬疑标签的媒体。注意,任何支持数组输入的参数,其元素之间的搜索逻辑为‘或’。所有参数之间的逻辑关系为‘与’。

  • 允许通过 Filters 控制返回的媒体信息种类(默认返回所有信息)。可选输入包括:

    1. 基础信息(basicInfo):包括媒体名称、分类、播放地址、封面图片等。
    2. 元信息(metaData):包括大小、时长、视频流信息、音频流信息等。
    3. 转码结果信息(transcodeInfo):包括该媒体转码生成的各种规格的媒体地址、视频流参数、音频流参数等。
    4. 转动图结果信息(animatedGraphicsInfo):对视频转动图(如 gif)后的动图信息。
    5. 采样截图信息(sampleSnapshotInfo):对视频采样截图后的截图信息。
    6. 雪碧图信息(imageSpriteInfo):对视频截取雪碧图后的雪碧图信息。
    7. 指定时间点截图信息(snapshotByTimeOffsetInfo):对视频依照指定时间点截图后,的截图信息。
    8. 视频打点信息(keyFrameDescInfo):对视频设置的打点信息。
    9. 转自适应码流信息(adaptiveDynamicStreamingInfo):包括规格、加密类型、打包格式等相关信息。
  • 允许对结果根据创建时间进行排序并分页返回,通过 Offset 和 Limit (见输入参数)来控制分页。

接口返回结果数限制:
- OffsetLimit 两个参数影响单次分页查询结果数。特别注意:当这2个值都缺省时,本接口最多只返回10条查询结果。 - 最大支持返回5000条搜索结果,超出部分不再支持查询。如果搜索结果量太大,建议使用更精细的筛选条件来减少搜索结果。


不推荐使用的条件筛选:

  • (不推荐:应使用 Names、NamePrefixes 或 Descriptions 替代)指定单个文本 Text 对媒体文件名或描述信息进行模糊搜索。
  • (不推荐:应使用 SourceTypes 替代)指定单个媒体文件来源 SourceType 进行搜索。
  • (不推荐:应使用 StreamIds 替代)指定单个推流直播码 StreamId 进行搜索。
  • (不推荐:应使用 CreateTime 替代)指定单个起始创建时间 StartTime 进行搜索。
  • (不推荐:应使用 CreateTime 替代)指定单个结尾创建时间 EndTime 进行搜索。

默认接口请求频率限制:100次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:SearchMedia。
Version String 公共参数,本接口取值:2018-07-17。
Region String 公共参数,此参数为可选参数。
SubAppId Integer 点播应用 ID。从2023年12月25日起开通点播的客户,如访问点播应用中的资源(无论是默认应用还是新创建的应用),必须将该字段填写为应用 ID。
示例值:123
FileIds.N Array of String 文件 ID 集合,匹配集合中的任意元素。
  • 数组长度限制:10。
  • 单个 ID 长度限制:40个字符。

  • 示例值:["5285485487985271487"]
    Names.N Array of String 文件名集合,模糊匹配媒体文件的文件名,匹配度越高,排序越优先。
  • 单个文件名长度限制:100个字符。
  • 数组长度限制:10。

  • 示例值:["abc.mp4"]
    NamePrefixes.N Array of String 文件名前缀,前缀匹配媒体文件的文件名。
  • 单个文件名前缀长度限制:100个字符。
  • 数组长度限制:10。

  • 示例值:["abc"]
    Descriptions.N Array of String 文件描述集合,模糊匹配媒体文件的描述,匹配度越高,排序越优先。
  • 单个描述长度限制:100个字符。
  • 数组长度限制:10。

  • 示例值:[""]
    ClassIds.N Array of Integer 分类 ID 集合,匹配集合指定 ID 的分类及其所有子类。
  • 数组长度限制:10。

  • 示例值:[1, 2]
    Tags.N Array of String 标签集合,匹配集合中任意元素。
  • 单个标签长度限制:32个字符。
  • 数组长度限制:16。

  • 示例值:["Sports", "Food"]
    Categories.N Array of String 文件类型。匹配集合中的任意元素:
  • Video: 视频文件
  • Audio: 音频文件
  • Image: 图片文件

  • 示例值:["Video"]
    SourceTypes.N Array of String 媒体文件来源集合,来源取值参见 SourceType
  • 数组长度限制:10。

  • 示例值:["Record"]
    StreamIds.N Array of String 推流直播码集合。匹配集合中的任意元素。
  • 数组长度限制:10。

  • 示例值:["StreamId1"]
    CreateTime TimeRange 匹配创建时间在此时间段内的文件。
  • 包含所指定的头尾时间点。
  • ExpireTime TimeRange 匹配过期时间在此时间段内的文件,无法检索到已过期文件。
  • 包含所指定的头尾时间点。
  • StorageRegions.N Array of String 媒体文件存储地区,如 ap-chongqing,参见地域列表
  • 单个存储地区长度限制:20个字符。
  • 数组长度限制:20。

  • 示例值:ap-chongqing
    StorageClasses.N Array of String 存储类型数组。可选值有:
  • STANDARD:标准存储。
  • STANDARD_IA:低频存储。
  • ARCHIVE:归档存储。
  • DEEP_ARCHIVE:深度归档存储。

  • 示例值:STANDARD
    MediaTypes.N Array of String 媒体文件封装格式集合,匹配集合中任意元素。
  • 数组长度限制:10。

  • 示例值:["mp4"]
    Status.N Array of String 媒体文件状态,匹配集合中任意元素。
  • Normal:正常;
  • SystemForbidden:平台封禁;
  • Forbidden:主动封禁。

  • 示例值:["Normal"]
    ReviewResults.N Array of String 媒体文件审核结果,匹配集合中任意元素。
  • pass:审核通过;
  • review:疑似违规,建议复审;
  • block:确认违规,建议封禁;
  • notModerated:未审核。

  • 示例值:["pass"]
    TrtcSdkAppIds.N Array of Integer TRTC 应用 ID 集合。匹配集合中的任意元素。
  • 数组长度限制:10。

  • 示例值:[123]
    TrtcRoomIds.N Array of String TRTC 房间 ID 集合。匹配集合中的任意元素。
  • 单个房间 ID 长度限制:64个字符;
  • 数组长度限制:10。

  • 示例值:["TrtcRoomId1"]
    Filters.N Array of String 指定所有媒体文件需要返回的信息,可同时指定多个信息,N 从 0 开始递增。如果未填写该字段,默认返回所有信息。选项有:
  • basicInfo(视频基础信息)。
  • metaData(视频元信息)。
  • transcodeInfo(视频转码结果信息)。
  • animatedGraphicsInfo(视频转动图结果信息)。
  • imageSpriteInfo(视频雪碧图信息)。
  • snapshotByTimeOffsetInfo(视频指定时间点截图信息)。
  • sampleSnapshotInfo(采样截图信息)。
  • keyFrameDescInfo(打点信息)。
  • adaptiveDynamicStreamingInfo(转自适应码流信息)。
  • miniProgramReviewInfo(小程序审核信息)。

  • 示例值:["basicInfo"]
    Sort SortBy 排序方式。
  • Sort.Field 可选 CreateTime 。
  • 当 Text、 Names 或 Descriptions 不为空时,Sort.Field 字段无效, 搜索结果将以匹配度排序。
  • Offset Integer
    分页返回的起始偏移量,默认值:0。将返回第 Offset 到第 Offset+Limit-1 条。
  • 取值范围:Offset + Limit 不超过5000。(参见:接口返回结果数限制

  • 示例值:0
    Limit Integer
    分页返回的记录条数,默认值:10。将返回第 Offset 到第 Offset+Limit-1 条。
  • 取值范围:Offset + Limit 不超过5000。(参见:接口返回结果数限制

  • 示例值:10
    Text String (不推荐:应使用 Names、NamePrefixes 或 Descriptions 替代)
    搜索文本,模糊匹配媒体文件名称或描述信息,匹配项越多,匹配度越高,排序越优先。长度限制:64个字符。
    示例值:abc
    SourceType String (不推荐:应使用 SourceTypes 替代)
    媒体文件来源,来源取值参见 SourceType
    示例值:Record
    StreamId String (不推荐:应使用 StreamIds 替代)
    推流直播码。
    示例值:StreamId1
    StartTime String (不推荐:应使用 CreateTime 替代)
    创建时间的开始时间。
  • 大于等于开始时间。
  • 当 CreateTime.After 也存在时,将优先使用 CreateTime.After。
  • 格式按照 ISO 8601标准表示,详见 ISO 日期格式说明

  • 示例值:2020-09-07T00:00:00+08:00
    EndTime String (不推荐:应使用 CreateTime 替代)
    创建时间的结束时间。
  • 小于结束时间。
  • 当 CreateTime.Before 也存在时,将优先使用 CreateTime.Before。
  • 格式按照 ISO 8601标准表示,详见 ISO 日期格式说明

  • 示例值:2020-09-09T23:59:59+08:00
    Vids.N Array of String 该字段已无效。
    示例值:[""]
    Vid String 该字段已无效。
    示例值:""

    3. 输出参数

    参数名称 类型 描述
    TotalCount Integer 符合搜索条件的记录总数。
  • 最大值:5000。当命中记录数超过5000时,该字段将返回 5000,而非实际命中总数。

  • 示例值:100
    MediaInfoSet Array of MediaInfo 媒体文件信息列表。
    RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

    4. 示例

    示例1 根据标签搜索一定时间范围内的上传文件,并且按创建时间降序排序

    搜索标签为 tag1 和 tag2 、创建时间在 2020-12-10T07:25:52Z 到 2020-12-13T07:25:52Z 之间的、文件来源为 Upload 的文件,并按创建时间进行降序排序。

    输入示例

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: SearchMedia
    <公共请求参数>
    
    {
        "Sort": {
            "Field": "CreateTime",
            "Order": "Desc"
        },
        "CreateTime": {
            "After": "2020-12-10T07:25:52Z",
            "Before": "2020-12-13T07:25:52Z"
        },
        "SourceTypes": [
            "Upload"
        ],
        "Tags": [
            "tag2",
            "tag1"
        ]
    }

    输出示例

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "TotalCount": 1,
            "MediaInfoSet": [
                {
                    "FileId": "5285485487985271487",
                    "BasicInfo": {
                        "Name": "Sport file",
                        "Description": "",
                        "CreateTime": "2020-12-11T07:25:52Z",
                        "UpdateTime": "2020-12-11T07:25:52Z",
                        "ExpireTime": "9999-12-31T23:59:59Z",
                        "ClassId": 123,
                        "ClassName": "测试",
                        "ClassPath": "测试",
                        "CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
                        "Type": "mp4",
                        "MediaUrl": "http://xx.vod2.myqcloud.com/xxx/xx/f0.mp4",
                        "TagSet": [
                            "tag1",
                            "tag2"
                        ],
                        "SourceInfo": {
                            "SourceType": "Record",
                            "SourceContext": "",
                            "TrtcRecordInfo": {
                                "SdkAppId": 1,
                                "RoomId": "RoomId",
                                "TaskId": "TaskId",
                                "UserIds": [
                                    "UserId"
                                ]
                            },
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "StorageRegion": "ap-chongqing",
                        "Category": "Image",
                        "Vid": "5285485487985271487",
                        "Status": "Normal",
                        "StorageClass": "STANDARD"
                    },
                    "MetaData": {
                        "Size": 10556,
                        "Container": "m4a",
                        "Duration": 3601,
                        "Bitrate": 246035,
                        "Height": 480,
                        "Width": 640,
                        "Rotate": 0,
                        "VideoDuration": 3601,
                        "AudioDuration": 3601,
                        "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                        "VideoStreamSet": [
                            {
                                "Bitrate": 246000,
                                "Height": 480,
                                "Width": 640,
                                "Codec": "h264",
                                "CodecTag": "avc1",
                                "Fps": 222,
                                "DynamicRangeInfo": {
                                    "Type": "HDR",
                                    "HDRType": "hdr10"
                                }
                            }
                        ],
                        "AudioStreamSet": [
                            {
                                "Codec": "aac",
                                "SamplingRate": 44100,
                                "Bitrate": 35
                            }
                        ]
                    },
                    "TranscodeInfo": {
                        "TranscodeSet": [
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.mp4",
                                "Definition": 0,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "m4a",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.f210.m3u8",
                                "Definition": 211,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "mov",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
                                "Definition": 10000,
                                "Duration": 145,
                                "Size": 265,
                                "Bitrate": 2840055,
                                "Height": 1080,
                                "Width": 1920,
                                "Container": "hls,applehttp",
                                "Md5": "bfcf7c6f154b18890661f9e80b0731d0",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 2794233,
                                        "Height": 1080,
                                        "Width": 1920,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 24,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "SamplingRate": 44100,
                                        "Bitrate": 45822,
                                        "Codec": "aac"
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            }
                        ]
                    },
                    "AnimatedGraphicsInfo": {
                        "AnimatedGraphicsSet": [
                            {
                                "Url": "http://125xx.vod2.myqcloud.com/xx/xx/f20000.gif",
                                "Definition": 20000,
                                "Container": "gif",
                                "Height": 480,
                                "Width": 640,
                                "Bitrate": 1000000,
                                "Size": 600000,
                                "Md5": "bfcf7c6f154b1842a661f9e80b07a1d0",
                                "StartTimeOffset": 10,
                                "EndTimeOffset": 15
                            }
                        ]
                    },
                    "SampleSnapshotInfo": {
                        "SampleSnapshotSet": [
                            {
                                "Definition": 10,
                                "SampleType": "percent",
                                "WaterMarkDefinition": [
                                    0
                                ],
                                "Interval": 10,
                                "ImageUrlSet": [
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx1.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx2.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx3.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx4.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx5.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx6.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx7.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx8.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx9.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx10.png"
                                ]
                            }
                        ]
                    },
                    "ImageSpriteInfo": {
                        "ImageSpriteSet": [
                            {
                                "Definition": 10,
                                "Height": 576,
                                "Width": 1024,
                                "TotalCount": 100,
                                "ImageUrlSet": [
                                    "http://xx.vod2.myqcloud.com/xx/xx/imageSprite/xx.100_0.jpg"
                                ],
                                "WebVttUrl": "http://xx.vod2.myqcloud.com/xxxx/xxxx/imageSprite/xx.vtt"
                            }
                        ]
                    },
                    "SnapshotByTimeOffsetInfo": {
                        "SnapshotByTimeOffsetSet": [
                            {
                                "Definition": 10,
                                "PicInfoSet": [
                                    {
                                        "TimeOffset": 0,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx1.jpg"
                                    },
                                    {
                                        "TimeOffset": 1000,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx2.jpg"
                                    }
                                ]
                            }
                        ]
                    },
                    "KeyFrameDescInfo": {
                        "KeyFrameDescSet": [
                            {
                                "TimeOffset": 1,
                                "Content": "abc"
                            },
                            {
                                "TimeOffset": 100,
                                "Content": "def"
                            }
                        ]
                    },
                    "MiniProgramReviewInfo": {
                        "MiniProgramReviewList": [
                            {
                                "Url": "url",
                                "Definition": 0,
                                "ReviewResult": "Pass",
                                "ReviewSummary": [
                                    {
                                        "Confidence": 0,
                                        "Type": "Porn",
                                        "Suggestion": "pass"
                                    }
                                ],
                                "MetaData": {
                                    "Rotate": 0,
                                    "Container": "mp4",
                                    "AudioDuration": 0,
                                    "Md5": "md5",
                                    "VideoStreamSet": [
                                        {
                                            "Width": 0,
                                            "Codec": "h264",
                                            "CodecTag": "avc1",
                                            "Bitrate": 0,
                                            "Fps": 0,
                                            "Height": 0,
                                            "DynamicRangeInfo": {
                                                "Type": "HDR",
                                                "HDRType": "hdr10"
                                            }
                                        }
                                    ],
                                    "Height": 0,
                                    "VideoDuration": 0,
                                    "Width": 0,
                                    "Duration": 0,
                                    "Size": 0,
                                    "Bitrate": 0,
                                    "AudioStreamSet": [
                                        {
                                            "SamplingRate": 0,
                                            "Codec": "h264",
                                            "Bitrate": 0
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "AdaptiveDynamicStreamingInfo": {
                        "AdaptiveDynamicStreamingSet": [
                            {
                                "Size": 10556,
                                "DrmType": "drm",
                                "Definition": 0,
                                "Url": "url",
                                "Package": "HLS",
                                "SubStreamSet": [],
                                "DigitalWatermarkType": "NONE",
                                "CopyRightWatermarkText": "NONE"
                            }
                        ]
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Url": "url",
                                "Format": "vtt",
                                "Name": "name",
                                "Language": "cn",
                                "Id": "id"
                            }
                        ]
                    },
                    "ReviewInfo": null
                }
            ]
        }
    }

    示例2 根据文件名字前缀搜索一定时间范围内的文件,并且按创建时间降序排序

    搜索文件名前缀为 Sport、创建时间在 2020-12-10T07:25:52Z 到 2020-12-13T07:25:52Z 之间的文件,并按创建时间进行降序排序。

    输入示例

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: SearchMedia
    <公共请求参数>
    
    {
        "Sort": {
            "Field": "CreateTime",
            "Order": "Desc"
        },
        "NamePrefixes": [
            "Sport"
        ],
        "CreateTime": {
            "After": "2020-12-10T07:25:52Z",
            "Before": "2020-12-13T07:25:52Z"
        }
    }

    输出示例

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "TotalCount": 1,
            "MediaInfoSet": [
                {
                    "FileId": "5285485487985271487",
                    "BasicInfo": {
                        "Name": "Sport file",
                        "Description": "",
                        "CreateTime": "2020-12-11T07:25:52Z",
                        "UpdateTime": "2020-12-11T07:25:52Z",
                        "ExpireTime": "9999-12-31T23:59:59Z",
                        "ClassId": 123,
                        "ClassName": "测试",
                        "ClassPath": "测试",
                        "CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
                        "Type": "mp4",
                        "MediaUrl": "http://xx.vod2.myqcloud.com/xxx/xx/f0.mp4",
                        "TagSet": [],
                        "SourceInfo": {
                            "SourceType": "Record",
                            "SourceContext": "",
                            "TrtcRecordInfo": {
                                "SdkAppId": 1,
                                "RoomId": "RoomId",
                                "TaskId": "TaskId",
                                "UserIds": [
                                    "UserId"
                                ]
                            },
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "StorageRegion": "ap-chongqing",
                        "Category": "Video",
                        "Vid": "5285485487985271487",
                        "Status": "Normal",
                        "StorageClass": "STANDARD"
                    },
                    "MetaData": {
                        "Size": 10556,
                        "Container": "m4a",
                        "Duration": 3601,
                        "Bitrate": 246035,
                        "Height": 480,
                        "Width": 640,
                        "Rotate": 0,
                        "VideoDuration": 3601,
                        "AudioDuration": 3601,
                        "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                        "VideoStreamSet": [
                            {
                                "Bitrate": 246000,
                                "Height": 480,
                                "Width": 640,
                                "Codec": "h264",
                                "CodecTag": "avc1",
                                "Fps": 222,
                                "DynamicRangeInfo": {
                                    "Type": "HDR",
                                    "HDRType": "hdr10"
                                }
                            }
                        ],
                        "AudioStreamSet": [
                            {
                                "Codec": "aac",
                                "SamplingRate": 44100,
                                "Bitrate": 35
                            }
                        ]
                    },
                    "TranscodeInfo": {
                        "TranscodeSet": [
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.mp4",
                                "Definition": 0,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "m4a",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.f210.m3u8",
                                "Definition": 211,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "mov",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
                                "Definition": 10000,
                                "Duration": 145,
                                "Size": 265,
                                "Bitrate": 2840055,
                                "Height": 1080,
                                "Width": 1920,
                                "Container": "hls,applehttp",
                                "Md5": "bfcf7c6f154b18890661f9e80b0731d0",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 2794233,
                                        "Height": 1080,
                                        "Width": 1920,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 24,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "SamplingRate": 44100,
                                        "Bitrate": 45822,
                                        "Codec": "aac"
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            }
                        ]
                    },
                    "AnimatedGraphicsInfo": {
                        "AnimatedGraphicsSet": [
                            {
                                "Url": "http://125xx.vod2.myqcloud.com/xx/xx/f20000.gif",
                                "Definition": 20000,
                                "Container": "gif",
                                "Height": 480,
                                "Width": 640,
                                "Bitrate": 1000000,
                                "Size": 600000,
                                "Md5": "bfcf7c6f154b1842a661f9e80b07a1d0",
                                "StartTimeOffset": 10,
                                "EndTimeOffset": 15
                            }
                        ]
                    },
                    "SampleSnapshotInfo": {
                        "SampleSnapshotSet": [
                            {
                                "Definition": 10,
                                "SampleType": "percent",
                                "WaterMarkDefinition": [
                                    0
                                ],
                                "Interval": 10,
                                "ImageUrlSet": [
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx1.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx2.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx3.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx4.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx5.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx6.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx7.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx8.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx9.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx10.png"
                                ]
                            }
                        ]
                    },
                    "ImageSpriteInfo": {
                        "ImageSpriteSet": [
                            {
                                "Definition": 10,
                                "Height": 576,
                                "Width": 1024,
                                "TotalCount": 100,
                                "ImageUrlSet": [
                                    "http://xx.vod2.myqcloud.com/xx/xx/imageSprite/xx.100_0.jpg"
                                ],
                                "WebVttUrl": "http://xx.vod2.myqcloud.com/xxxx/xxxx/imageSprite/xx.vtt"
                            }
                        ]
                    },
                    "SnapshotByTimeOffsetInfo": {
                        "SnapshotByTimeOffsetSet": [
                            {
                                "Definition": 10,
                                "PicInfoSet": [
                                    {
                                        "TimeOffset": 0,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx1.jpg"
                                    },
                                    {
                                        "TimeOffset": 1000,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx2.jpg"
                                    }
                                ]
                            }
                        ]
                    },
                    "KeyFrameDescInfo": {
                        "KeyFrameDescSet": [
                            {
                                "TimeOffset": 1,
                                "Content": "abc"
                            },
                            {
                                "TimeOffset": 100,
                                "Content": "def"
                            }
                        ]
                    },
                    "MiniProgramReviewInfo": {
                        "MiniProgramReviewList": [
                            {
                                "Url": "url",
                                "Definition": 0,
                                "ReviewResult": "Pass",
                                "ReviewSummary": [
                                    {
                                        "Confidence": 0,
                                        "Type": "Porn",
                                        "Suggestion": "pass"
                                    }
                                ],
                                "MetaData": {
                                    "Rotate": 0,
                                    "Container": "mp4",
                                    "AudioDuration": 0,
                                    "Md5": "md5",
                                    "VideoStreamSet": [
                                        {
                                            "Width": 0,
                                            "Codec": "h264",
                                            "CodecTag": "avc1",
                                            "Bitrate": 0,
                                            "Fps": 0,
                                            "Height": 0,
                                            "DynamicRangeInfo": {
                                                "Type": "HDR",
                                                "HDRType": "hdr10"
                                            }
                                        }
                                    ],
                                    "Height": 0,
                                    "VideoDuration": 0,
                                    "Width": 0,
                                    "Duration": 0,
                                    "Size": 0,
                                    "Bitrate": 0,
                                    "AudioStreamSet": [
                                        {
                                            "SamplingRate": 0,
                                            "Codec": "h264",
                                            "Bitrate": 0
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "AdaptiveDynamicStreamingInfo": {
                        "AdaptiveDynamicStreamingSet": [
                            {
                                "Size": 10556,
                                "DrmType": "drm",
                                "Definition": 0,
                                "Url": "url",
                                "Package": "HLS",
                                "SubStreamSet": [],
                                "DigitalWatermarkType": "NONE",
                                "CopyRightWatermarkText": "NONE"
                            }
                        ]
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Url": "url",
                                "Format": "vtt",
                                "Name": "name",
                                "Language": "cn",
                                "Id": "id"
                            }
                        ]
                    },
                    "ReviewInfo": null
                }
            ]
        }
    }

    示例3 根据文件名字模糊搜索一定时间范围内的文件,并且按创建时间降序排序

    搜索文件名字与关键词 Sport 相匹配的、创建时间在 2020-12-10T07:25:52Z 到 2020-12-13T07:25:52Z 之间的文件,并按创建时间进行降序排序。

    输入示例

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: SearchMedia
    <公共请求参数>
    
    {
        "Sort": {
            "Field": "CreateTime",
            "Order": "Desc"
        },
        "Names": [
            "Sport"
        ],
        "CreateTime": {
            "After": "2020-12-10T07:25:52Z",
            "Before": "2020-12-13T07:25:52Z"
        }
    }

    输出示例

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "TotalCount": 1,
            "MediaInfoSet": [
                {
                    "FileId": "5285485487985271487",
                    "BasicInfo": {
                        "Name": "Sport file",
                        "Description": "",
                        "CreateTime": "2020-12-11T07:25:52Z",
                        "UpdateTime": "2020-12-11T07:25:52Z",
                        "ExpireTime": "9999-12-31T23:59:59Z",
                        "ClassId": 123,
                        "ClassName": "测试",
                        "ClassPath": "测试",
                        "CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
                        "Type": "mp4",
                        "MediaUrl": "http://xx.vod2.myqcloud.com/xxx/xx/f0.mp4",
                        "TagSet": [],
                        "SourceInfo": {
                            "SourceType": "Record",
                            "SourceContext": "",
                            "TrtcRecordInfo": {
                                "SdkAppId": 1,
                                "RoomId": "RoomId",
                                "TaskId": "TaskId",
                                "UserIds": [
                                    "UserId"
                                ]
                            },
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "StorageRegion": "ap-chongqing",
                        "Category": "Video",
                        "Vid": "5285485487985271487",
                        "Status": "Normal",
                        "StorageClass": "STANDARD"
                    },
                    "MetaData": {
                        "Size": 10556,
                        "Container": "m4a",
                        "Duration": 3601,
                        "Bitrate": 246035,
                        "Height": 480,
                        "Width": 640,
                        "Rotate": 0,
                        "VideoDuration": 3601,
                        "AudioDuration": 3601,
                        "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                        "VideoStreamSet": [
                            {
                                "Bitrate": 246000,
                                "Height": 480,
                                "Width": 640,
                                "Codec": "h264",
                                "CodecTag": "avc1",
                                "Fps": 222,
                                "DynamicRangeInfo": {
                                    "Type": "HDR",
                                    "HDRType": "hdr10"
                                }
                            }
                        ],
                        "AudioStreamSet": [
                            {
                                "Codec": "aac",
                                "SamplingRate": 44100,
                                "Bitrate": 35
                            }
                        ]
                    },
                    "TranscodeInfo": {
                        "TranscodeSet": [
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.mp4",
                                "Definition": 0,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "m4a",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.f210.m3u8",
                                "Definition": 211,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "mov",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
                                "Definition": 10000,
                                "Duration": 145,
                                "Size": 265,
                                "Bitrate": 2840055,
                                "Height": 1080,
                                "Width": 1920,
                                "Container": "hls,applehttp",
                                "Md5": "bfcf7c6f154b18890661f9e80b0731d0",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 2794233,
                                        "Height": 1080,
                                        "Width": 1920,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 24,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "SamplingRate": 44100,
                                        "Bitrate": 45822,
                                        "Codec": "aac"
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            }
                        ]
                    },
                    "AnimatedGraphicsInfo": {
                        "AnimatedGraphicsSet": [
                            {
                                "Url": "http://125xx.vod2.myqcloud.com/xx/xx/f20000.gif",
                                "Definition": 20000,
                                "Container": "gif",
                                "Height": 480,
                                "Width": 640,
                                "Bitrate": 1000000,
                                "Size": 600000,
                                "Md5": "bfcf7c6f154b1842a661f9e80b07a1d0",
                                "StartTimeOffset": 10,
                                "EndTimeOffset": 15
                            }
                        ]
                    },
                    "SampleSnapshotInfo": {
                        "SampleSnapshotSet": [
                            {
                                "Definition": 10,
                                "SampleType": "percent",
                                "WaterMarkDefinition": [
                                    0
                                ],
                                "Interval": 10,
                                "ImageUrlSet": [
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx1.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx2.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx3.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx4.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx5.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx6.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx7.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx8.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx9.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx10.png"
                                ]
                            }
                        ]
                    },
                    "ImageSpriteInfo": {
                        "ImageSpriteSet": [
                            {
                                "Definition": 10,
                                "Height": 576,
                                "Width": 1024,
                                "TotalCount": 100,
                                "ImageUrlSet": [
                                    "http://xx.vod2.myqcloud.com/xx/xx/imageSprite/xx.100_0.jpg"
                                ],
                                "WebVttUrl": "http://xx.vod2.myqcloud.com/xxxx/xxxx/imageSprite/xx.vtt"
                            }
                        ]
                    },
                    "SnapshotByTimeOffsetInfo": {
                        "SnapshotByTimeOffsetSet": [
                            {
                                "Definition": 10,
                                "PicInfoSet": [
                                    {
                                        "TimeOffset": 0,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx1.jpg"
                                    },
                                    {
                                        "TimeOffset": 1000,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx2.jpg"
                                    }
                                ]
                            }
                        ]
                    },
                    "KeyFrameDescInfo": {
                        "KeyFrameDescSet": [
                            {
                                "TimeOffset": 1,
                                "Content": "abc"
                            },
                            {
                                "TimeOffset": 100,
                                "Content": "def"
                            }
                        ]
                    },
                    "MiniProgramReviewInfo": {
                        "MiniProgramReviewList": [
                            {
                                "Url": "url",
                                "Definition": 0,
                                "ReviewResult": "Pass",
                                "ReviewSummary": [
                                    {
                                        "Confidence": 0,
                                        "Type": "Porn",
                                        "Suggestion": "pass"
                                    }
                                ],
                                "MetaData": {
                                    "Rotate": 0,
                                    "Container": "mp4",
                                    "AudioDuration": 0,
                                    "Md5": "md5",
                                    "VideoStreamSet": [
                                        {
                                            "Width": 0,
                                            "Codec": "h264",
                                            "CodecTag": "avc1",
                                            "Bitrate": 0,
                                            "Fps": 0,
                                            "Height": 0,
                                            "DynamicRangeInfo": {
                                                "Type": "HDR",
                                                "HDRType": "hdr10"
                                            }
                                        }
                                    ],
                                    "Height": 0,
                                    "VideoDuration": 0,
                                    "Width": 0,
                                    "Duration": 0,
                                    "Size": 0,
                                    "Bitrate": 0,
                                    "AudioStreamSet": [
                                        {
                                            "SamplingRate": 0,
                                            "Codec": "h264",
                                            "Bitrate": 0
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "AdaptiveDynamicStreamingInfo": {
                        "AdaptiveDynamicStreamingSet": [
                            {
                                "Size": 10556,
                                "DrmType": "drm",
                                "Definition": 0,
                                "Url": "url",
                                "Package": "HLS",
                                "SubStreamSet": [],
                                "DigitalWatermarkType": "NONE",
                                "CopyRightWatermarkText": "NONE"
                            }
                        ]
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Url": "url",
                                "Format": "vtt",
                                "Name": "name",
                                "Language": "cn",
                                "Id": "id"
                            }
                        ]
                    },
                    "ReviewInfo": null
                }
            ]
        }
    }

    示例4 根据推流直播码搜索一定时间范围内的录制文件,并且按创建时间降序排序

    搜索直播码为 StreamId_test1 和 StreamId_test2 、创建时间在 2020-12-10T07:25:52Z 到 2020-12-13T07:25:52Z 之间的录制文件,按创建时间进行降序排序,只返回符合条件的第一个文件。

    输入示例

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: SearchMedia
    <公共请求参数>
    
    {
        "Sort": {
            "Field": "CreateTime",
            "Order": "Desc"
        },
        "StreamIds": [
            "StreamId_test2",
            "StreamId_test1"
        ],
        "Limit": 1,
        "SourceTypes": [
            "Record"
        ],
        "Offset": 0,
        "CreateTime": {
            "After": "2020-12-10T07:25:52Z",
            "Before": "2020-12-13T07:25:52Z"
        }
    }

    输出示例

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "TotalCount": 1,
            "MediaInfoSet": [
                {
                    "FileId": "5285485487985271487",
                    "BasicInfo": {
                        "Name": "Sport file",
                        "Description": "",
                        "CreateTime": "2020-12-11T07:25:52Z",
                        "UpdateTime": "2020-12-11T07:25:52Z",
                        "ExpireTime": "9999-12-31T23:59:59Z",
                        "ClassId": 123,
                        "ClassName": "测试",
                        "ClassPath": "测试",
                        "CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
                        "Type": "mp4",
                        "MediaUrl": "http://xx.vod2.myqcloud.com/xxx/xx/f0.mp4",
                        "TagSet": [
                            "tag1",
                            "tag2"
                        ],
                        "SourceInfo": {
                            "SourceType": "Record",
                            "SourceContext": "",
                            "TrtcRecordInfo": {
                                "SdkAppId": 1,
                                "RoomId": "RoomId",
                                "TaskId": "TaskId",
                                "UserIds": [
                                    "UserId"
                                ]
                            },
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "StorageRegion": "ap-chongqing",
                        "Category": "Image",
                        "Vid": "5285485487985271487",
                        "Status": "Normal",
                        "StorageClass": "STANDARD"
                    },
                    "MetaData": {
                        "Size": 10556,
                        "Container": "m4a",
                        "Duration": 3601,
                        "Bitrate": 246035,
                        "Height": 480,
                        "Width": 640,
                        "Rotate": 0,
                        "VideoDuration": 3601,
                        "AudioDuration": 3601,
                        "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                        "VideoStreamSet": [
                            {
                                "Bitrate": 246000,
                                "Height": 480,
                                "Width": 640,
                                "Codec": "h264",
                                "CodecTag": "avc1",
                                "Fps": 222,
                                "DynamicRangeInfo": {
                                    "Type": "HDR",
                                    "HDRType": "hdr10"
                                }
                            }
                        ],
                        "AudioStreamSet": [
                            {
                                "Codec": "aac",
                                "SamplingRate": 44100,
                                "Bitrate": 35
                            }
                        ]
                    },
                    "TranscodeInfo": {
                        "TranscodeSet": [
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.mp4",
                                "Definition": 0,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "m4a",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.f210.m3u8",
                                "Definition": 211,
                                "Bitrate": 563477,
                                "Height": 378,
                                "Width": 672,
                                "Container": "mov",
                                "Duration": 3601,
                                "Size": 10502,
                                "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 222,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            },
                            {
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
                                "Definition": 10000,
                                "Duration": 145,
                                "Size": 265,
                                "Bitrate": 2840055,
                                "Height": 1080,
                                "Width": 1920,
                                "Container": "hls,applehttp",
                                "Md5": "bfcf7c6f154b18890661f9e80b0731d0",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 2794233,
                                        "Height": 1080,
                                        "Width": 1920,
                                        "Codec": "h264",
                                        "CodecTag": "avc1",
                                        "Fps": 24,
                                        "DynamicRangeInfo": {
                                            "Type": "HDR",
                                            "HDRType": "hdr10"
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "SamplingRate": 44100,
                                        "Bitrate": 45822,
                                        "Codec": "aac"
                                    }
                                ],
                                "DigitalWatermarkType": "None",
                                "CopyRightWatermarkText": "None"
                            }
                        ]
                    },
                    "AnimatedGraphicsInfo": {
                        "AnimatedGraphicsSet": [
                            {
                                "Url": "http://125xx.vod2.myqcloud.com/xx/xx/f20000.gif",
                                "Definition": 20000,
                                "Container": "gif",
                                "Height": 480,
                                "Width": 640,
                                "Bitrate": 1000000,
                                "Size": 600000,
                                "Md5": "bfcf7c6f154b1842a661f9e80b07a1d0",
                                "StartTimeOffset": 10,
                                "EndTimeOffset": 15
                            }
                        ]
                    },
                    "SampleSnapshotInfo": {
                        "SampleSnapshotSet": [
                            {
                                "Definition": 10,
                                "SampleType": "percent",
                                "WaterMarkDefinition": [
                                    0
                                ],
                                "Interval": 10,
                                "ImageUrlSet": [
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx1.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx2.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx3.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx4.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx5.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx6.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx7.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx8.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx9.png",
                                    "http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx10.png"
                                ]
                            }
                        ]
                    },
                    "ImageSpriteInfo": {
                        "ImageSpriteSet": [
                            {
                                "Definition": 10,
                                "Height": 576,
                                "Width": 1024,
                                "TotalCount": 100,
                                "ImageUrlSet": [
                                    "http://xx.vod2.myqcloud.com/xx/xx/imageSprite/xx.100_0.jpg"
                                ],
                                "WebVttUrl": "http://xx.vod2.myqcloud.com/xxxx/xxxx/imageSprite/xx.vtt"
                            }
                        ]
                    },
                    "SnapshotByTimeOffsetInfo": {
                        "SnapshotByTimeOffsetSet": [
                            {
                                "Definition": 10,
                                "PicInfoSet": [
                                    {
                                        "TimeOffset": 0,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx1.jpg"
                                    },
                                    {
                                        "TimeOffset": 1000,
                                        "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx2.jpg"
                                    }
                                ]
                            }
                        ]
                    },
                    "KeyFrameDescInfo": {
                        "KeyFrameDescSet": [
                            {
                                "TimeOffset": 1,
                                "Content": "abc"
                            },
                            {
                                "TimeOffset": 100,
                                "Content": "def"
                            }
                        ]
                    },
                    "MiniProgramReviewInfo": {
                        "MiniProgramReviewList": [
                            {
                                "Url": "url",
                                "Definition": 0,
                                "ReviewResult": "Pass",
                                "ReviewSummary": [
                                    {
                                        "Confidence": 0,
                                        "Type": "Porn",
                                        "Suggestion": "pass"
                                    }
                                ],
                                "MetaData": {
                                    "Rotate": 0,
                                    "Container": "mp4",
                                    "AudioDuration": 0,
                                    "Md5": "md5",
                                    "VideoStreamSet": [
                                        {
                                            "Width": 0,
                                            "Codec": "h264",
                                            "CodecTag": "avc1",
                                            "Bitrate": 0,
                                            "Fps": 0,
                                            "Height": 0,
                                            "DynamicRangeInfo": {
                                                "Type": "HDR",
                                                "HDRType": "hdr10"
                                            }
                                        }
                                    ],
                                    "Height": 0,
                                    "VideoDuration": 0,
                                    "Width": 0,
                                    "Duration": 0,
                                    "Size": 0,
                                    "Bitrate": 0,
                                    "AudioStreamSet": [
                                        {
                                            "SamplingRate": 0,
                                            "Codec": "h264",
                                            "Bitrate": 0
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "AdaptiveDynamicStreamingInfo": {
                        "AdaptiveDynamicStreamingSet": [
                            {
                                "Size": 10556,
                                "DrmType": "drm",
                                "Definition": 0,
                                "Url": "url",
                                "Package": "HLS",
                                "SubStreamSet": [],
                                "DigitalWatermarkType": "NONE",
                                "CopyRightWatermarkText": "NONE"
                            }
                        ]
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Url": "url",
                                "Format": "vtt",
                                "Name": "name",
                                "Language": "cn",
                                "Id": "id"
                            }
                        ]
                    },
                    "ReviewInfo": null
                }
            ]
        }
    }

    示例5 根据分类搜索一定时间范围内的图片文件,并只返回文件基础信息,并且按创建时间降序排序

    搜索 ClassId 为123、创建时间在 2020-12-10T07:25:52Z 到 2020-12-13T07:25:52Z 之间的图片文件,按创建时间进行降序排序,并且只返回文件的基础信息。

    输入示例

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: SearchMedia
    <公共请求参数>
    
    {
        "Sort": {
            "Field": "CreateTime",
            "Order": "Desc"
        },
        "Filters": [
            "basicInfo"
        ],
        "Categories": [
            "Image"
        ],
        "ClassIds": [
            123
        ],
        "CreateTime": {
            "After": "2020-12-10T07:25:52Z",
            "Before": "2020-12-13T07:25:52Z"
        }
    }

    输出示例

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "TotalCount": 2,
            "MediaInfoSet": [
                {
                    "FileId": "5285890811175706012",
                    "BasicInfo": {
                        "Name": "雾",
                        "Description": "",
                        "CreateTime": "2020-12-11T07:02:36Z",
                        "UpdateTime": "2020-12-11T07:02:37Z",
                        "ExpireTime": "9999-12-31T23:59:59Z",
                        "ClassId": 123,
                        "ClassName": "图标",
                        "ClassPath": "图标",
                        "CoverUrl": "",
                        "Type": "png",
                        "MediaUrl": "http://xxx.com/Tmf3xphxGoUA.png",
                        "TagSet": [],
                        "StorageRegion": "ap-shanghai",
                        "SourceInfo": {
                            "SourceType": "Upload",
                            "SourceContext": "",
                            "TrtcRecordInfo": {
                                "SdkAppId": 1,
                                "RoomId": "RoomId",
                                "TaskId": "TaskId",
                                "UserIds": [
                                    "UserId"
                                ]
                            },
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "Vid": "5285890811175706012",
                        "Category": "Image",
                        "Status": "Normal",
                        "StorageClass": "STANDARD"
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Url": "url",
                                "Format": "vtt",
                                "Name": "name",
                                "Language": "cn",
                                "Id": "id"
                            }
                        ]
                    },
                    "ReviewInfo": null,
                    "MetaData": null,
                    "TranscodeInfo": null,
                    "AnimatedGraphicsInfo": null,
                    "SampleSnapshotInfo": null,
                    "ImageSpriteInfo": null,
                    "SnapshotByTimeOffsetInfo": null,
                    "KeyFrameDescInfo": null,
                    "AdaptiveDynamicStreamingInfo": null,
                    "MiniProgramReviewInfo": null
                },
                {
                    "FileId": "5285890811175698692",
                    "BasicInfo": {
                        "Name": "多云",
                        "Description": "",
                        "CreateTime": "2020-12-11T07:02:35Z",
                        "UpdateTime": "2020-12-11T07:02:36Z",
                        "ExpireTime": "9999-12-31T23:59:59Z",
                        "ClassId": 737598,
                        "ClassName": "图标",
                        "ClassPath": "图标",
                        "CoverUrl": "",
                        "Type": "png",
                        "MediaUrl": "http://xxx/uAgVpElena0A.png",
                        "TagSet": [],
                        "StorageRegion": "ap-shanghai",
                        "SourceInfo": {
                            "SourceType": "Upload",
                            "SourceContext": "",
                            "TrtcRecordInfo": {
                                "SdkAppId": 1,
                                "RoomId": "RoomId",
                                "TaskId": "TaskId",
                                "UserIds": [
                                    "UserId"
                                ]
                            },
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "Vid": "5285890811175698692",
                        "Category": "Image",
                        "Status": "Normal",
                        "StorageClass": "STANDARD"
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Url": "url",
                                "Format": "vtt",
                                "Name": "name",
                                "Language": "cn",
                                "Id": "id"
                            }
                        ]
                    },
                    "ReviewInfo": null,
                    "MetaData": null,
                    "TranscodeInfo": null,
                    "AnimatedGraphicsInfo": null,
                    "SampleSnapshotInfo": null,
                    "ImageSpriteInfo": null,
                    "SnapshotByTimeOffsetInfo": null,
                    "KeyFrameDescInfo": null,
                    "AdaptiveDynamicStreamingInfo": null,
                    "MiniProgramReviewInfo": null
                }
            ]
        }
    }

    5. 开发者资源

    腾讯云 API 平台

    腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

    API Inspector

    用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

    SDK

    云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

    命令行工具

    6. 错误码

    以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

    错误码 描述
    FailedOperation 操作失败。
    FailedOperation.InvalidVodUser 没有开通点播业务。
    InternalError 内部错误。
    InternalError.GetMediaListError 内部错误:获取媒体列表错误。
    InvalidParameterValue.Categories 无效的文件类型。
    InvalidParameterValue.ClassIds 参数值错误:ClassIds 无效。
    InvalidParameterValue.EndTime 参数值错误:EndTime 无效。
    InvalidParameterValue.FileIds FileIds 参数错误。
    InvalidParameterValue.NamePrefixes 无效的文件名前缀。
    InvalidParameterValue.Names Names数组中元素过多。
    InvalidParameterValue.Offset 参数值错误:Offset 无效。
    InvalidParameterValue.Sort 参数值错误:Sort 无效。
    InvalidParameterValue.SourceType 参数值错误:SourceType 无效。
    InvalidParameterValue.SourceTypes 未知的媒体文件来源。
    InvalidParameterValue.StartTime 参数值错误:StartTime 无效。
    InvalidParameterValue.StorageRegions 参数值错误:StorageRegions 无效。
    InvalidParameterValue.StreamIds 无效的流ID参数。
    InvalidParameterValue.SubAppId 参数值错误:子应用 ID。
    InvalidParameterValue.Tags 参数值错误:Tags 无效。
    InvalidParameterValue.Text 参数值错误:搜索文本。
    InvalidParameterValue.Types 无效的 Types 参数。
    InvalidParameterValue.Vids 无效的 Vids 参数。
    LimitExceeded 超过配额限制。
    UnauthorizedOperation 未授权操作。