tencent cloud

文档反馈

DescribeMediaInfos

最后更新时间:2024-10-31 14:30:48

    1. API Description

    Domain name for API request: vod.tencentcloudapi.com.

    1. This API is used to get the information of multiple media files. Specifically, the information returned is as follows:
      1. basicInfo: Basic information including the file name, category, playback URL, and thumbnail.
      2. metaData: Metadata including the file size, duration, video stream information, and audio stream information.
      3. transcodeInfo: Transcoding information including the URLs, video stream parameters, and audio stream parameters of transcoding outputs.
      4. animatedGraphicsInfo: The information of the animated images (such as GIF images) generated.
      5. sampleSnapshotInfo: The information of the sampled screenshots generated.
      6. imageSpriteInfo: The information of the image sprites generated.
      7. snapshotByTimeOffsetInfo: The information of the time point screenshots generated.
      8. keyFrameDescInfo: The video timestamp information.
      9. adaptiveDynamicStreamingInfo: Adaptive bitrate information including the specifications, encryption type, and formats of the streams.
      10. reviewInfo: Moderation details for audio/video content and thumbnails.
    2. You can specify what information to return.

    A maximum of 100 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: DescribeMediaInfos.
    Version Yes String Common Params. The value used for this API: 2018-07-17.
    Region No String Common Params. This parameter is not required.
    FileIds.N Yes Array of String List of media file IDs. N starts from 0 and can be up to 19.
    SubAppId No Integer The VOD application ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
    Filters.N No Array of String The types of information to return. You can specify multiple information types. N starts from 0. If you do not specify this parameter, all information will be returned. The supported information types are as follows:
  • basicInfo (basic information)
  • metaData (video metadata)
  • transcodeInfo (transcoding information)
  • animatedGraphicsInfo (animated image information)
  • imageSpriteInfo (image sprite information)
  • snapshotByTimeOffsetInfo (time point screenshot information)
  • sampleSnapshotInfo (sampled screenshot information)
  • keyFrameDescInfo (timestamp information)
  • adaptiveDynamicStreamingInfo (adaptive bitrate information)
  • miniProgramReviewInfo (WeChat Mini Program moderation information)
  • subtitleInfo (subtitle information)
  • reviewInfo (moderation information)
  • 3. Output Parameters

    Parameter Name Type Description
    MediaInfoSet Array of MediaInfo Media file information list.
    NotExistFileIdSet Array of String List of IDs of files that do not exist.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Describe Media Infos

    Get all media information without specifying filters.

    Input Example

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeMediaInfos
    <Public Request Parameter>
    
    {
        "FileIds": [
            "5285485487985271488",
            "5285485487985271487"
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "MediaInfoSet": [
                {
                    "FileId": "5285485487985271487",
                    "BasicInfo": {
                        "Name": "test file",
                        "Description": "",
                        "CreateTime": "2017-01-23T07:25:52Z",
                        "UpdateTime": "2017-01-23T07:25:52Z",
                        "ExpireTime": "2017-03-23T07:25:52Z",
                        "ClassId": 1,
                        "ClassName": "Test",
                        "ClassPath": "Test",
                        "CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
                        "Type": "mp4",
                        "MediaUrl": "http://xx.vod2.myqcloud.com/xx/xx/f0.mp4",
                        "TagSet": [],
                        "SourceInfo": {
                            "SourceType": "Record",
                            "SourceContext": "",
                            "TrtcRecordInfo": null,
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "Category": "Video",
                        "Vid": "",
                        "StorageClass": "STANDARD",
                        "StorageRegion": "gzp",
                        "Status": "Normal"
                    },
                    "MetaData": {
                        "AudioDuration": 3601,
                        "VideoDuration": 3601,
                        "Md5": "",
                        "Size": 10556,
                        "Container": "m4a",
                        "Duration": 3601,
                        "Bitrate": 246035,
                        "Height": 480,
                        "Width": 640,
                        "Rotate": 0,
                        "VideoStreamSet": [
                            {
                                "Bitrate": 246000,
                                "Height": 480,
                                "Width": 640,
                                "Codec": "h264",
                                "Fps": 222,
                                "CodecTag": "",
                                "DynamicRangeInfo": {
                                    "Type": "SDR",
                                    "HDRType": ""
                                }
                            }
                        ],
                        "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",
                                "DigitalWatermarkType": "None",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "Fps": 222,
                                        "CodecTag": "",
                                        "DynamicRangeInfo": {
                                            "Type": "SDR",
                                            "HDRType": ""
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "CopyRightWatermarkText": ""
                            },
                            {
                                "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",
                                "DigitalWatermarkType": "None",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 246000,
                                        "Height": 480,
                                        "Width": 640,
                                        "Codec": "h264",
                                        "Fps": 222,
                                        "CodecTag": "",
                                        "DynamicRangeInfo": {
                                            "Type": "SDR",
                                            "HDRType": ""
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Bitrate": 35
                                    }
                                ],
                                "CopyRightWatermarkText": ""
                            },
                            {
                                "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",
                                "DigitalWatermarkType": "None",
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 2794233,
                                        "Height": 1080,
                                        "Width": 1920,
                                        "Codec": "h264",
                                        "Fps": 24,
                                        "CodecTag": "",
                                        "DynamicRangeInfo": {
                                            "Type": "SDR",
                                            "HDRType": ""
                                        }
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "SamplingRate": 44100,
                                        "Bitrate": 45822,
                                        "Codec": "aac"
                                    }
                                ],
                                "CopyRightWatermarkText": ""
                            }
                        ]
                    },
                    "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": [],
                                "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"
                                    }
                                ]
                            }
                        ]
                    },
                    "MiniProgramReviewInfo": {
                        "MiniProgramReviewList": [
                            {
                                "Url": "http://xx.vod2.myqcloud.com/xx/xx/f0.mp4",
                                "Definition": 0,
                                "ReviewResult": "pass",
                                "ReviewSummary": [
                                    {
                                        "Confidence": 0,
                                        "Type": "Porn",
                                        "Suggestion": "pass"
                                    }
                                ],
                                "MetaData": {
                                    "Rotate": 0,
                                    "Container": "m4a",
                                    "AudioDuration": 0,
                                    "VideoDuration": 3601,
                                    "Md5": "",
                                    "VideoStreamSet": [
                                        {
                                            "Bitrate": 246000,
                                            "Height": 480,
                                            "Width": 640,
                                            "Codec": "h264",
                                            "Fps": 222,
                                            "CodecTag": "",
                                            "DynamicRangeInfo": {
                                                "Type": "SDR",
                                                "HDRType": ""
                                            }
                                        }
                                    ],
                                    "Bitrate": 563477,
                                    "Height": 378,
                                    "Width": 672,
                                    "Duration": 3601,
                                    "Size": 10502,
                                    "AudioStreamSet": [
                                        {
                                            "Codec": "aac",
                                            "SamplingRate": 44100,
                                            "Bitrate": 35
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "AdaptiveDynamicStreamingInfo": {
                        "AdaptiveDynamicStreamingSet": [
                            {
                                "Definition": 0,
                                "Package": "HLS",
                                "DrmType": "None",
                                "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
                                "Size": 0,
                                "DigitalWatermarkType": "",
                                "CopyRightWatermarkText": "",
                                "SubStreamSet": []
                            }
                        ]
                    },
                    "KeyFrameDescInfo": {
                        "KeyFrameDescSet": [
                            {
                                "TimeOffset": 1,
                                "Content": "abc"
                            },
                            {
                                "TimeOffset": 100,
                                "Content": "def"
                            }
                        ]
                    },
                    "SubtitleInfo": {
                        "SubtitleSet": [
                            {
                                "Id": "subtitleId",
                                "Name": "English",
                                "Language": "en-US",
                                "Format": "vtt",
                                "Url": "http://123.vod2.myqcloud.com/vodgzp123/15517123183853310575/subtitles/subtitleId.vtt"
                            }
                        ]
                    },
                    "ReviewInfo": {
                        "MediaReviewInfo": {
                            "Definition": 10,
                            "Suggestion": "pass",
                            "TypeSet": [],
                            "ReviewTime": "2022-10-08T10:00:00Z"
                        },
                        "CoverReviewInfo": null
                    }
                }
            ],
            "NotExistFileIdSet": [
                "5285485487985271488"
            ]
        }
    }
    

    Example2 Only obtain basic media information

    Only obtain basic media information, Filters specifies basicInfo.

    Input Example

    POST / HTTP/1.1
    Host: vod.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeMediaInfos
    <Public Request Parameter>
    
    {
        "Filters": [
            "basicInfo"
        ],
        "FileIds": [
            "5285485487985271488",
            "5285485487985271487"
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
            "MediaInfoSet": [
                {
                    "FileId": "5285485487985271487",
                    "BasicInfo": {
                        "Name": "test file",
                        "Description": "",
                        "CreateTime": "2017-01-23T07:25:52Z",
                        "UpdateTime": "2017-01-23T07:25:52Z",
                        "ExpireTime": "2017-03-23T07:25:52Z",
                        "ClassId": 1,
                        "ClassName": "Test",
                        "ClassPath": "Test",
                        "CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
                        "Type": "mp4",
                        "MediaUrl": "http://xx.vod2.myqcloud.com/xx/xx/f0.mp4",
                        "TagSet": [],
                        "SourceInfo": {
                            "SourceType": "Record",
                            "SourceContext": "",
                            "TrtcRecordInfo": null,
                            "WebPageRecordInfo": null,
                            "LiveRecordInfo": null
                        },
                        "Category": "Video",
                        "Vid": "",
                        "StorageClass": "STANDARD",
                        "StorageRegion": "gzp",
                        "Status": "Normal"
                    },
                    "MetaData": null,
                    "TranscodeInfo": null,
                    "AdaptiveDynamicStreamingInfo": null,
                    "AnimatedGraphicsInfo": null,
                    "SampleSnapshotInfo": null,
                    "ImageSpriteInfo": null,
                    "MiniProgramReviewInfo": null,
                    "SubtitleInfo": null,
                    "SnapshotByTimeOffsetInfo": null,
                    "KeyFrameDescInfo": null,
                    "ReviewInfo": null
                }
            ],
            "NotExistFileIdSet": [
                "5285485487985271488"
            ]
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    FailedOperation.InvalidVodUser The VOD service is not activated.
    InternalError Internal error.
    InternalError.GetMediaListError Internal error: an error occurred while getting the media list.
    InvalidParameter Invalid parameter.
    InvalidParameterValue.FileIds Incorrect FileIds parameter.
    InvalidParameterValue.FileIdsEmpty The FileIds array is empty.
    UnauthorizedOperation Unauthorized operation.
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持