同步获取META信息接口(FetchMetaInfo)

最近更新时间:2020-10-19 10:22:39

接口描述

同步获取文件meta信息的接口,用于获取源文件的meta信息,仅支持mp4、flv、m3u8、mp3、dash格式

请求方式

POST

请求参数:

参数名 类型 是否必须 描述
SrcPath string 源文件在KS3的存储路径

返回参数

参数名 类型 是否必须 描述
ErrNum int 错误码,0:成功;非0:失败
ErrMsg string 描述本次请求错误的原因
MetaInfo json string meta信息,与回调结果中的meta信息结构一致,参数说明详见转码结果回调

请求示例

POST /?Action=FetchMetaInfo

&Version=2017-01-01

&X-Amz-Algorithm=AWS4-HMAC-SHA256

&X-Amz-Date=20170519T060855Z

&X-Amz-Credential=xxxxx

&X-Amz-SignedHeaders=xxxxx

&X-Amz-Signature=xxxxx HTTP/1.1

HOST: kvs.cn-beijing-6.api.ksyun.com

Accept: application/json

Content-Type: application/json;charset=utf-8

Content-Length: %LEN

{

    "SrcPath": "/wangshuai9/ksyun1.flv"

}

返回示例


HTTP/1.1 200 OK

Server: ksyun-open-platform

Date: Sun, 7 Jan 2018 12:28:06 GMT

Content-Type: application/json;charset=UTF-8

Transfer-Encoding: chunked

{

    "MetaInfo":"{

        "streams":[

            {

                "codec_name":"h264",

                "codec_long_name":"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",

                "profile":"Baseline",

                "codec_type":"video",

                "codec_time_base":"103931/5018000",

                "codec_tag_string":"avc1",

                "codec_tag":"0x31637661",

                "r_frame_rate":"97/4",

                "avg_frame_rate":"2509000/103931",

                "time_base":"1/90000",

                "start_time":"0.000000",

                "duration_ts":9353790,

                "duration":"103.931000",

                "bit_rate":"1969387",

                "nb_frames":"2509",

                "width":1280,

                "height":720,

                "coded_width":1280,

                "coded_height":720,

                "rotate": "90",//当rotate有值时,返回值中的分辨率是rotate值旋转后的。当rotate为空时,分辨率为原始分辨率。

                "sample_aspect_ratio":"0:1",

                "display_aspect_ratio":"0:1",

                "pix_fmt":"yuv420p",

                "level":41,

                "chroma_location":"left",

                "refs":1,

                "is_avc":"true",

                "bits_per_raw_sample":"8"

            },

            {

                "index":1,

                "codec_name":"mp3",

                "codec_long_name":"MP3 (MPEG audio layer 3)",

                "codec_type":"audio",

                "codec_time_base":"1/44100",

                "codec_tag_string":"mp4a",

                "codec_tag":"0x6134706d",

                "r_frame_rate":"0/0",

                "avg_frame_rate":"0/0",

                "time_base":"1/44100",

                "start_time":"0.000000",

                "duration_ts":4643712,

                "duration":"105.299592",

                "bit_rate":"63999",

                "max_bit_rate":"64000",

                "nb_frames":"4031",

                "sample_fmt":"s16p",

                "sample_rate":"44100",

                "channels":2,

                "channel_layout":"stereo"

            }

        ],

        "format":{

        "nb_streams":2,

        "format_name":"mov,mp4,m4a,3gp,3g2,mj2",

        "format_long_name":"QuickTime / MOV",

        "duration":"105.300000",

        "size":"26499154",

        "bit_rate":"2013231",

        "probe_score":100

       }

    }",

    "ErrNum":0,

    "ErrMsg":"success"

}

金山云,开启您的云计算之旅

免费注册