日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

獲取媒體元信息

通過視頻管理功能獲取媒體文件元信息,如分辨率、碼率、幀率、編碼標準等。用于媒體檢索、播放展示、智能管理等,提升媒體的運營與管理效率。

應用場景

篩選檢索

以某個媒體元信息作為檢索條件,進行精確匹配、前(后)綴匹配、模糊匹配等多種檢索方式,查找期望的媒體文件列表。

媒體管理

根據媒體元信息,如分辨率、碼率、幀率、編碼標準等對媒體文件進行分類管理,在此基礎上根據業務規則進行播放展示。

支持音視頻格式列表

分類

格式

音頻

AAC、MP3、AC3、OPUS等多種音頻格式。

視頻

MP4、MPEG-TS、MKV、MOV、AVI、FLV、M3U8等多種視頻格式。

前提條件

使用方法

調用DetectMediaMeta - 獲取媒體文件元信息接口獲取媒體元信息。

如下以在名稱為test-projectIMM項目中,獲取OSS路徑為oss://test-bucket/test-object.mp4的媒體元信息為例。

請求示例

{
    "ProjectName": "test-project",
   "SourceURI": "oss://test-bucket/test-object.mp4"
}

返回示例

{
    "ProduceTime": "2022-04-24T02:39:57Z",
    "VideoStreams": [
        {
            "CodecTag": "0x31637661",
            "FrameRate": "60/1",
            "ColorSpace": "bt709",
            "FrameCount": 220,
            "Duration": 3.665678,
            "ColorRange": "tv",
            "CodecName": "h264",
            "Bitrate": 19908892,
            "BitDepth": 8,
            "Profile": "High",
            "CodecTagString": "avc1",
            "HasBFrames": 1,
            "AverageFrameRate": "19800000/329911",
            "ColorPrimaries": "bt709",
            "Language": "en",
            "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "Height": 1080,
            "PixelFormat": "yuv420p",
            "Level": 42,
            "Width": 1920,
            "TimeBase": "1/90000",
            "ColorTransfer": "bt709"
        }
    ],
    "RequestId": "09A12708-A41D-0356-AB0E-0F2BCE*****",
    "Size": 10432415,
    "VideoWidth": 1920,
    "FormatLongName": "QuickTime / MOV",
    "Duration": 3.7141,
    "Bitrate": 22470940,
    "AudioStreams": [
        {
            "CodecTag": "0x6134706d",
            "ChannelLayout": "stereo",
            "FrameCount": 173,
            "StartTime": 0.0235,
            "Index": 1,
            "Duration": 3.690667,
            "CodecName": "aac",
            "Bitrate": 320087,
            "SampleFormat": "fltp",
            "Channels": 2,
            "CodecTagString": "mp4a",
            "SampleRate": 48000,
            "Language": "en",
            "CodecLongName": "AAC (Advanced Audio Coding)",
            "TimeBase": "1/48000"
        }
    ],
    "Addresses": [
        {
            "Language": "zh-Hans",
            "Township": "望京街道",
            "AddressLine": "北京市朝陽區望京街道東田運動健身游泳俱樂部寶星華庭公寓",
            "Country": "中國",
            "City": "",
            "District": "朝陽區",
            "Province": "北京市"
        }
    ],
    "StreamCount": 2,
    "VideoHeight": 1080,
    "FormatName": "mov,mp4,m4a,3gp,3g2,mj2",
    "LatLong": "+39.998800,+116.480900"
}

示例代碼

Python SDK為例,獲取媒體元信息的完整示例代碼如下。

# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys

from typing import List

from alibabacloud_imm20200930.client import Client as imm20200930Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_imm20200930 import models as imm_20200930_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient


class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client() -> imm20200930Client:
        """
        使用AK&SK初始化賬號Client
        @return: Client
        @throws Exception
        """
        # 工程代碼泄露可能會導致 AccessKey 泄露,并威脅賬號下所有資源的安全性。以下代碼示例僅供參考。
        # 建議使用更安全的 STS 方式,更多鑒權訪問方式請參見:http://bestwisewords.com/document_detail/378659.html。
        config = open_api_models.Config(
            # 必填,請確保代碼運行環境設置了環境變量 ALIBABA_CLOUD_ACCESS_KEY_ID。,
            access_key_id=os.environ['ALIBABA_CLOUD_ACCESS_KEY_ID'],
            # 必填,請確保代碼運行環境設置了環境變量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。,
            access_key_secret=os.environ['ALIBABA_CLOUD_ACCESS_KEY_SECRET']
        )
        # Endpoint 請參考 https://api.aliyun.com/product/imm
        config.endpoint = f'imm.cn-hangzhou.aliyuncs.com'
        return imm20200930Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        detect_media_meta_request = imm_20200930_models.DetectMediaMetaRequest(
            project_name='test-project',
            source_uri='oss://test-bucket/test-object.mp4'
        )
        runtime = util_models.RuntimeOptions()
        try:
            # 復制代碼運行請自行打印 API 的返回值
            client.detect_media_meta_with_options(detect_media_meta_request, runtime)
        except Exception as error:
            # 此處僅做打印展示,請謹慎對待異常處理,在工程項目中切勿直接忽略異常。
            # 錯誤 message
            print(error.message)
            # 診斷地址
            print(error.data.get("Recommend"))
            UtilClient.assert_as_string(error.message)

    @staticmethod
    async def main_async(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        detect_media_meta_request = imm_20200930_models.DetectMediaMetaRequest(
            project_name='test-project',
            source_uri='oss://test-bucket/test-object.mp4'
        )
        runtime = util_models.RuntimeOptions()
        try:
            # 復制代碼運行請自行打印 API 的返回值
            await client.detect_media_meta_with_options_async(detect_media_meta_request, runtime)
        except Exception as error:
            # 此處僅做打印展示,請謹慎對待異常處理,在工程項目中切勿直接忽略異常。
            # 錯誤 message
            print(error.message)
            # 診斷地址
            print(error.data.get("Recommend"))
            UtilClient.assert_as_string(error.message)


if __name__ == '__main__':
    Sample.main(sys.argv[1:])