tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Retrieve Media Information Synchronization Request

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-01-12 18:29:46

Feature Description

The GetMediainfo API is used to obtain information of a media file.

Authorization Description

When using with a sub-account, the cos:GetObject permission is required. For details, please refer to COS action. For other CI permissions, please refer to Cloud Infinite action.

Activating a Service

Using this feature requires enabling Cloud Infinite in advance and binding a bucket. For details, see Bind Bucket.
Use this feature requires enabling Media Processing Service in advance via console or API. For details, see Enable Media Processing Service.

Use Limits

When using this API, please first confirm the relevant restrictions. For details, see Usage Limits.

Fee Description

This API is a paid service. Incurred fees will be charged by Cloud Infinite. For detailed billing instructions, see Media processing.


Request

Request sample:

GET /<ObjectKey>?ci-process=videoinfo HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Note:
Authorization: Auth String. For details, see the Request Signature document.
ObjectKey is a bucket object.

Request header.

This API only uses common request headers. For details, see Common Request Headers documentation.

Request parameters.

The parameters are described as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
ci-process
None.
operation type, fixed usage videoinfo
String
Yes

Request body.

This request has no request body.

Response

Response Headers

This API only returns the public response header. For details, see Common Response Headers documentation.

Response Body

The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<MediaInfo>
<Stream>
<Video>
<Index></Index>
<CodecName></CodecName>
<CodecLongName></CodecLongName>
<CodecTimeBase></CodecTimeBase>
<CodecTagString></CodecTagString>
<CodecTag></CodecTag>
<ColorPrimaries></ColorPrimaries>
<ColorRange></ColorRange>
<ColorTransfer></ColorTransfer>
<Profile></Profile>
<Width></Width>
<Height></Height>
<HasBFrame></HasBFrame>
<RefFrames></RefFrames>
<Sar></Sar>
<Dar></Dar>
<PixFormat></PixFormat>
<FieldOrder></FieldOrder>
<Level></Level>
<Fps></Fps>
<AvgFps></AvgFps>
<Timebase></Timebase>
<StartTime></StartTime>
<Duration></Duration>
<Bitrate></Bitrate>
<NumFrames></NumFrames>
<Language></Language>
</Video>
<Audio>
<Index></Index>
<CodecName></CodecName>
<CodecLongName></CodecLongName>
<CodecTimeBase></CodecTimeBase>
<CodecTagString></CodecTagString>
<CodecTag></CodecTag>
<SampleFmt></SampleFmt>
<SampleRate></SampleRate>
<Channel></Channel>
<ChannelLayout></ChannelLayout>
<Timebase></Timebase>
<StartTime></StartTime>
<Duration></Duration>
<Bitrate></Bitrate>
<Language></Language>
</Audio>
<Subtitle>
<Index></Index>
<Language></Language>
</Subtitle>
</Stream>
<Format>
<NumStream></NumStream>
<NumProgram></NumProgram>
<FormatName></FormatName>
<FormatLongName></FormatLongName>
<StartTime></StartTime>
<Duration></Duration>
<Bitrate></Bitrate>
<Size></Size>
</Format>
</MediaInfo>
</Response>
The data are as follows:
Node Name (Keyword)
Parent Node
Description
Type
Response
None.
Container for saving results
Container
Container node Response content:
Node Name (Keyword)
Parent Node
Description
Type
MediaInfo
Response
Detailed information of the media
Container
Content of Container node
MediaInfo
:
Node Name (Keyword)
Parent Node
Description
Type
Format
Response.MediaInfo
Format information
Container
Stream
Response.MediaInfo
Stream information
Container
Container node Stream content:
Node Name (Keyword)
Parent Node
Description
Type
Video
Response.MediaInfo.Stream
video information
Container array
Audio
Response.MediaInfo.Stream
audio content
Container array
Subtitle
Response.MediaInfo.Stream
subtitle information
Container array
the content of Container node Format (do not return if a field fails to obtain a valid value)
Node Name (Keyword)
Parent Node
Description
Type
NumStream
Response.MediaInfo.Format
the number of Streams (including Video, Audio, and Subtitle)
String
NumProgram
Response.MediaInfo.Format
the number of programs
String
FormatName
Response.MediaInfo.Format
Container Format Name
String
FormatLongName
Response.MediaInfo.Format
Detailed Container Format Name
String
StartTime
Response.MediaInfo.Format
Start Time, in seconds
String
Duration
Response.MediaInfo.Format
Duration, in seconds
String
Bitrate
Response.MediaInfo.Format
Bitrate, in kbps
String
Size
Response.MediaInfo.Format
Size in bytes
String
the content of Container node Video (do not return if a field fails to obtain a valid value)
Node Name (Keyword)
Parent Node
Description
Type
Index
Response.MediaInfo.Stream.Video
The number of this stream
String
CodecName
Response.MediaInfo.Stream.Video
encoding/decoding format name
String
CodecLongName
Response.MediaInfo.Stream.Video
encoding/decoding format name
String
CodecTimeBase
Response.MediaInfo.Stream.Video
Encoding time base
String
CodecTagString
Response.MediaInfo.Stream.Video
encoding tag name
String
CodecTag
Response.MediaInfo.Stream.Video
encoding tag
String
ColorPrimaries
Response.MediaInfo.Stream.Video
Chromogen
String
ColorRange
Response.MediaInfo.Stream.Video
Color range
String
ColorTransfer
Response.MediaInfo.Stream.Video
color channel
String
Profile
Response.MediaInfo.Stream.Video
Video encoding gear selection
String
Height
Response.MediaInfo.Stream.Video
Video height, unit px
String
Width
Response.MediaInfo.Stream.Video
Video width, unit px
String
HasBFrame
Response.MediaInfo.Stream.Video
Whether there is a B-frame. 1 indicates yes, 0 indicates no.
String
RefFrames
Response.MediaInfo.Stream.Video
Reference frame count for video encoding
String
Sar
Response.MediaInfo.Stream.Video
Sampling aspect ratio
String
Dar
Response.MediaInfo.Stream.Video
Display aspect ratio
String
PixFormat
Response.MediaInfo.Stream.Video
video pixel format
String
FieldOrder
Response.MediaInfo.Stream.Video
Field Order
String
Level
Response.MediaInfo.Stream.Video
Video encoding level
String
Fps
Response.MediaInfo.Stream.Video
video frame rate
String
AvgFps
Response.MediaInfo.Stream.Video
Average frame rate
String
Timebase
Response.MediaInfo.Stream.Video
Time base
String
StartTime
Response.MediaInfo.Stream.Video
Video start time, in seconds
String
Duration
Response.MediaInfo.Stream.Video
Video duration, in seconds
String
Bitrate
Response.MediaInfo.Stream.Video
Bitrate, in kbps
String
NumFrames
Response.MediaInfo.Stream.Video
Total number of frames
String
Language
Response.MediaInfo.Stream.Video
Language
String
the content of Container node Audio (do not return if a field fails to obtain a valid value)
Node Name (Keyword)
Parent Node
Description
Type
Index
Response.MediaInfo.Stream.Audio
The number of this stream
String
CodecName
Response.MediaInfo.Stream.Audio
encoding/decoding format name
String
CodecLongName
Response.MediaInfo.Stream.Audio
encoding/decoding format name
String
CodecTimeBase
Response.MediaInfo.Stream.Audio
Encoding time base
String
CodecTagString
Response.MediaInfo.Stream.Audio
encoding tag name
String
CodecTag
Response.MediaInfo.Stream.Audio
encoding tag
String
SampleFmt
Response.MediaInfo.Stream.Audio
sample format
String
SampleRate
Response.MediaInfo.Stream.Audio
sampling rate
String
Channel
Response.MediaInfo.Stream.Audio
Number of channels
String
ChannelLayout
Response.MediaInfo.Stream.Audio
Channel format
String
Timebase
Response.MediaInfo.Stream.Audio
Time base
String
StartTime
Response.MediaInfo.Stream.Audio
Audio start time, in seconds
String
Duration
Response.MediaInfo.Stream.Audio
Audio duration, in seconds
String
Bitrate
Response.MediaInfo.Stream.Audio
Bitrate, in kbps
String
Language
Response.MediaInfo.Stream.Audio
Language
String
Container node Subtitle content:
Node Name (Keyword)
Parent Node
Description
Type
Index
Response.MediaInfo.Stream.Subtitle
The number of this stream
String
Language
Response.MediaInfo.Stream.Subtitle
Language, und indicates no query result
String

Error Codes

This request returns common error responses and error codes. For more information, see Error Codes.

Examples

Request

GET /for-test.mp4?ci-process=videoinfo HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Fri, 10 Mar 2016 09:45:46 GMT
Authorization: q-sign-algorithm=sha1&q-ak=*************************************&q-key-time=1484213027;32557109027&q-header-list=host&q-url-param-list=acl&q-signature=**************************************
Content-Length: 0

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 666
Connection: keep-alive
Date: Fri, 10 Mar 2016 09:45:46 GMT
Server: tencent-ci
x-cos-request-id: NTg3NzRiMjVfYmRjMzVfMTViMl82ZGZmNw==


<Response>
<MediaInfo>
<Format>
<Bitrate>1014.950000</Bitrate>
<Duration>10.125000</Duration>
<FormatLongName>QuickTime / MOV</FormatLongName>
<FormatName>mov,mp4,m4a,3gp,3g2,mj2</FormatName>
<NumProgram>0</NumProgram>
<NumStream>2</NumStream>
<Size>1284547</Size>
<StartTime>0.000000</StartTime>
</Format>
<Stream>
<Audio>
<Bitrate>70.451000</Bitrate>
<Channel>1</Channel>
<ChannelLayout>mono</ChannelLayout>
<CodecLongName>AAC (Advanced Audio Coding)</CodecLongName>
<CodecName>aac</CodecName>
<CodecTag>0x6134706d</CodecTag>
<CodecTagString>mp4a</CodecTagString>
<CodecTimeBase>1/44100</CodecTimeBase>
<Duration>0.440294</Duration>
<Index>1</Index>
<Language>und</Language>
<SampleFmt>fltp</SampleFmt>
<SampleRate>44100</SampleRate>
<StartTime>0.000000</StartTime>
<Timebase>1/44100</Timebase>
</Audio>
<Subtitle/>
<Video>
<AvgFps>24/1</AvgFps>
<Bitrate>938.164000</Bitrate>
<CodecLongName>H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10</CodecLongName>
<CodecName>h264</CodecName>
<CodecTag>0x31637661</CodecTag>
<CodecTagString>avc1</CodecTagString>
<CodecTimeBase>1/12288</CodecTimeBase>
<ColorPrimaries>unknown</ColorPrimaries>
<ColorRange>unknown</ColorRange>
<ColorTransfer>unknown</ColorTransfer>
<Dar>40:53</Dar>
<Duration>0.124416</Duration>
<Fps>24.500000</Fps>
<HasBFrame>2</HasBFrame>
<Height>1280</Height>
<Index>0</Index>
<Language>und</Language>
<Level>32</Level>
<NumFrames>243</NumFrames>
<PixFormat>yuv420p</PixFormat>
<Profile>High</Profile>
<RefFrames>1</RefFrames>
<Sar>25600:25599</Sar>
<StartTime>0.000000</StartTime>
<Timebase>1/12288</Timebase>
<Width>966</Width>
</Video>
</Stream>
</MediaInfo>
</Response>


Ajuda e Suporte

Esta página foi útil?

comentários