GetAvinfo

更新时间:2025-08-18 15:52:06

获取音视频对象的元数据信息。需要具备 IAM wos:GetAvinfo 权限。

请求语法

GET /Key?avinfo HTTP/1.1
Host: Bucket.Endpoint
Date: Date
Authorization: Authorization

请求参数

名称 描述 是否必填
avinfo 音视频对象的元数据信息。
类型:字符串。

请求头

请使用 公共请求头

请求体

无。

响应语法

HTTP/1.1 StatusCode 
x-wos-request-id: RequestId 
Date: Date
Content-Type: type
Content-Length: length
Server: WS-web-server

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetAvinfoResult>
    <Streams>
        <Index>index</Index>
        <Codec_name>codec_name</Codec_name>
        <Codec_type>codec_type</Codec_type>
        <Width>width</Width>
        <Height>height</Height>
        <Pix_fmt>pix_fmt</Pix_fmt>
        <Duration>duration</Duration>
        <Bit_rate>bit_rate</Bit_rate>
        <Nb_frames>nb_frames</Nb_frames>
        <R_frame_rate>r_frame_rate</R_frame_rate>
        <Avg_frame_rate>avg_frame_rate</Avg_frame_rate>
    </Streams>
    <Format>
        <Nb_streams>nb_streams</Nb_streams>
        <Format_name>format_name</Format_name>
        <Duration>duration</Duration>
        <Size>size</Size>
        <Bit_rate>bit_rate</Bit_rate>
    </Format>
</GetAvinfoResult>

响应头

使用 公共响应头

响应体

在响应中,avinfo 以 XML 形式展现,具体描述见下表:

名称 描述
GetAvinfoResult 视频元数据信息。
类型:XML
Streams 媒体流信息。
类型:XML
Index 流索引号。
类型:正整数
Codec_name 编码器名称。
类型:字符串
Codec_type 编码器类型。
类型:字符串
Width 宽度。
类型:正整数
Height 高度。
类型:正整数
Pix_fmt 像素格式。
类型:字符串
Duration 总时长。
类型:字符串
Bit_rate 比特率。
类型:字符串
Nb_frames 帧数。
类型:字符串
R_frame_rate 真实基础帧率。
类型:字符串
Avg_frame_rate 平均帧率。
类型:字符串
sample_rate 采样率。
类型:字符串
Channels 音频数。
类型:正整数
Nb_streams 流数量。
类型:正整数
Format_name 格式名称。
类型:字符串
Size 对象大小。
类型:字符串

特殊错误

代码 信息
599 InputFile Invalid

示例

GET /test?avinfo HTTP/1.1
Host: testbucket.s3-cn-south-1.wcsapi.com
Date: Wed, 04 Nov 2020 03:09:24 GMT
x-wos-date:20201104T030923Z
Authorization: WOS-HMAC-SHA256 Credential=7e7dae54118c45a6ffd213a18c9d4847b51a73f1/20201104/cn-east-2/wos/wos_request, SignedHeaders=host;x-wos-content-sha256;x-wos-date, Signature=1c104d10373f9813ecba257d5f48eecbb44f87b572e14edb7fce6c51d64cae13

HTTP/1.1 200 OK
Server: WS-web-server
x-wos-request-id: 202829121210026220201104110923r44rlIlOsampled
Content-Type: application/xml;charset=UTF-8
Date: Wed, 04 Nov 2020 03:09:24 GMT
Content-Length: 885

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetAvinfoResult>
    <Streams>
        <Index>0</Index>
        <Codec_name>h264</Codec_name>
        <Codec_type>video</Codec_type>
        <Width>1366</Width>
        <Height>768</Height>
        <Pix_fmt>yuv420p</Pix_fmt>
        <Duration>2643.520000</Duration>
        <Bit_rate>1217993</Bit_rate>
        <Nb_frames>66088</Nb_frames>
        <R_frame_rate>25/1</R_frame_rate>
        <Avg_frame_rate>25/1</Avg_frame_rate>
    </Streams>
    <Streams>
        <Index>1</Index>
        <Codec_name>aac</Codec_name>
        <Codec_type>audio</Codec_type>
        <Sample_rate>44100</Sample_rate>
        <Channels>2</Channels>
        <Duration>2643.522177</Duration>
        <Bit_rate>127900</Bit_rate>
        <Nb_frames>113847</Nb_frames>
        <R_frame_rate>0/0</R_frame_rate>
        <Avg_frame_rate>0/0</Avg_frame_rate>
    </Streams>
    <Format>
        <Nb_streams>2</Nb_streams>
        <Format_name>mov,mp4,m4a,3gp,3g2,mj2</Format_name>
        <Duration>2643.523000</Duration>
        <Size>446437306</Size>
        <Bit_rate>1351037</Bit_rate>
    </Format>
</GetAvinfoResult>
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!