GetAvinfo

Last update:2022-03-01 18:01:07

Get the metadata of an audio/video object. IAM wos:GetAvinfo permission is required.

Request syntax

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

Request parameters

Name Description Required
avinfo Metadata of the of the audio/video object.
Type: String.
Yes

Request header

Please use Common Request Headers .

Request body

None.

Response syntax

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>

Response header

Use Common Response Headers.

Response body

In the response, the avinfo is listed in the form of XML. See descriptions in the following table.

Name Description
GetAvinfoResult Metadata.
Type: XML.
Streams Stream information.
Type: XML.
Index Stream index number.
Type: Positive integer.
Codec_name Encoder name.
Type: String.
Codec_type Encoder type.
Type: String.
Width Type: Positive integer.
Height Type: positive integer.
Pix_fmt Number of pixels.
Type: String.
Duration Total duration.
Type: String.
Bit_rate Bitrate.
Type: String.
Nb_frames Number of frames.
Type: String.
R_frame_rate Real frame rate.
Type: String.
Avg_frame_rate Average frame rate.
Type: String.
sample_rate Sampling Rate.
Type: String.
Channels Type: positive integer.
Nb_streams Number of streams.
Type: positive integer.
Format_name Format name.
Type: String.
Size Object size.
Type: String.

special error

Code Message
599 InputFile Invalid

Example

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>
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!