DescribeMediaInfos

Last updated: 2020-03-27 18:45:44

1. API Description

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

  1. This API can get multiple types of information of multiple media files, including:
    1. Basic information (basicInfo): media name, category, playback address, cover image, etc.
    2. Metadata (metaData): size, duration, video stream information, audio stream information, etc.
    3. Information of the transcoding result (transcodeInfo): addresses, video stream parameters, and audio stream parameters of the media files with various specifications generated by transcoding a media file.
    4. Information of the animated image generating result (animatedGraphicsInfo): information of an animated image (such as .gif) generated from a video.
    5. Information of a sampled screenshot (sampleSnapshotInfo): information of a sampled screenshot of a video.
    6. Information of an image sprite (imageSpriteInfo): information of an image sprite generated from a video.
    7. Information of a time point screenshot (snapshotByTimeOffsetInfo): information of a time point screenshot of a video.
    8. Information of a timestamp (keyFrameDescInfo): information of a timestamp set for a video.
    9. Information of transcoding to adaptive bitrate streaming (adaptiveDynamicStreamingInfo): specification, encryption type, container format, etc.
  2. The return packet can be configured to only contain certain information.

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

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 parameter. The value used for this API: DescribeMediaInfos.
Version Yes String Common parameter. The value used for this API: 2018-07-17.
Region No String Common parameter. This parameter is not required for this API.
FileIds.N Yes Array of String List of media file IDs. N starts from 0 and can be up to 19.
Filters.N No Array of String Specifies information entry that needs to be returned by all media files. Multiple entries can be specified simultaneously. N starts from 0. If this field is left empty, all information entries will be returned by default. Valid values:
  • basicInfo (basic video information).
  • metaData (video metadata).
  • transcodeInfo (result information of video transcoding).
  • animatedGraphicsInfo (result information of animated image generating task).
  • imageSpriteInfo (image sprite information).
  • snapshotByTimeOffsetInfo (time point screenshot information).
  • sampleSnapshotInfo (sampled screenshot information).
  • keyFrameDescInfo (timestamp information).
  • adaptiveDynamicStreamingInfo (information of adaptive bitrate streaming).
  • miniProgramReviewInfo (WeChat Mini Program audit information).
  • SubAppId No Integer Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.

    3. Output Parameters

    Parameter Name Type Description
    MediaInfoSet Array of MediaInfo Media file information list.
    Note: this field may return null, indicating that no valid values can be obtained.
    NotExistFileIdSet Array of String List of IDs of files that do not exist.
    Note: this field may return null, indicating that no valid values can be obtained.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Getting media details

    Input Example

    https://vod.tencentcloudapi.com/?Action=DescribeMediaInfos
    &FileIds.0=5285485487985271487
    &FileIds.1=5285485487985271488
    &<Common request parameters>

    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": ""
              },
              "StorageRegion": "gzp"
            },
            "MetaData": {
              "Size": 10556,
              "Container": "m4a",
              "Duration": 3601.0,
              "Bitrate": 246035,
              "Height": 480,
              "Width": 640,
              "Rotate": 0,
              "VideoStreamSet": [
                {
                  "Bitrate": 246000,
                  "Height": 480,
                  "Width": 640,
                  "Codec": "h264",
                  "Fps": 222
                }
              ],
              "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.0,
                  "Size": 10502,
                  "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                  "VideoStreamSet": [
                    {
                      "Bitrate": 246000,
                      "Height": 480,
                      "Width": 640,
                      "Codec": "h264",
                      "Fps": 222
                    }
                  ],
                  "AudioStreamSet": [
                    {
                      "Codec": "aac",
                      "SamplingRate": 44100,
                      "Bitrate": 35
                    }
                  ]
                },
                {
                  "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.f210.m3u8",
                  "Definition": 211,
                  "Bitrate": 563477,
                  "Height": 378,
                  "Width": 672,
                  "Container": "mov",
                  "Duration": 3601.0,
                  "Size": 10502,
                  "Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                  "VideoStreamSet": [
                    {
                      "Bitrate": 246000,
                      "Height": 480,
                      "Width": 640,
                      "Codec": "h264",
                      "Fps": 222
                    }
                  ],
                  "AudioStreamSet": [
                    {
                      "Codec": "aac",
                      "SamplingRate": 44100,
                      "Bitrate": 35
                    }
                  ]
                },
                {
                  "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
                  "Definition": 10000,
                  "Duration": 145.0,
                  "Size": 265,
                  "Bitrate": 2840055,
                  "Height": 1080,
                  "Width": 1920,
                  "Container": "hls,applehttp",
                  "Md5": "bfcf7c6f154b18890661f9e80b0731d0",
                  "VideoStreamSet": [
                    {
                      "Bitrate": 2794233,
                      "Height": 1080,
                      "Width": 1920,
                      "Codec": "h264",
                      "Fps": 24
                    }
                  ],
                  "AudioStreamSet": [
                    {
                      "SamplingRate": 44100,
                      "Bitrate": 45822,
                      "Codec": "aac"
                    }
                  ]
                }
              ]
            },
            "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.0,
                  "EndTimeOffset": 15.0
                }
              ]
            },
            "SampleSnapshotInfo": {
              "SampleSnapshotSet": [
                {
                  "Definition": 10,
                  "SampleType": "percent",
                  "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.0,
                      "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx1.jpg"
                    },
                    {
                      "TimeOffset": 1000.0,
                      "Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx2.jpg"
                    }
                  ]
                }
              ]
            },
            "KeyFrameDescInfo": {
              "KeyFrameDescSet": [
                {
                  "TimeOffset": 1.0,
                  "Content": "abc"
                },
                {
                  "TimeOffset": 100.0,
                  "Content": "def"
                }
              ]
            }
          }
        ],
        "NotExistFileIdSet": [
          "5285485487985271488"
        ]
      }
    }

    Example2 Getting only the basic information of a media file

    Input Example

    https://vod.tencentcloudapi.com/?Action=DescribeMediaInfos
    &FileIds.0=5285485487985271487
    &FileIds.1=5285485487985271488
    &Filters.0=basicInfo
    &<Common request parameters>

    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": ""
              },
              "StorageRegion": "gzp"
            },
            "MetaData": null,
            "TranscodeInfo": null,
            "AdaptiveDynamicStreamingInfo": null,
            "AnimatedGraphicsInfo": null,
            "SampleSnapshotInfo": null,
            "ImageSpriteInfo": null,
            "SnapshotByTimeOffsetInfo": null,
            "KeyFrameDescInfo": null
          }
        ],
        "NotExistFileIdSet": [
          "5285485487985271488"
        ]
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    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
    InternalError Internal error.
    InvalidParameter Invalid parameter.
    InvalidParameterValue.FileIds Incorrect FileIds parameter.
    UnauthorizedOperation Unauthorized operation.