tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

Media Information APIs

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-03-01 10:49:05

Overview

This document provides an overview of APIs and SDK code samples for media information.
Note:
The COS JavaScript SDK version must be at least v1.3.1.
API
Operation
Description
Querying file information
Queries media file information

Querying File Information

Feature description

This API is used to query the information of a media file.
Note:
Before using this API, make sure that the media processing feature has been enabled in the data processing section in the console; otherwise, the error media bucket unbinded, bucket's host is unavailable will be reported.

Sample code

var config = {
// Replace with your own bucket information
Bucket: 'examplebucket-1250000000', /* Bucket (required) */
Region: 'COS_REGION', /* Bucket region (required) */
};
cos.request({
Bucket: config.Bucket,
Region: config.Region,
Method: 'GET',
Key: 'test.mp4', /* Media file in bucket (required) */
Query: {
'ci-process': 'videoinfo' /** Fixed value (required) */
}
}, function (err, data) {
console.log(err || data);
});

Parameter description

Parameter
Description
Type
Required
Bucket
Bucket name in the format of BucketName-APPID.
String
Yes
Region
Bucket region. For the enumerated values, see Regions and Access Endpoints.
String
Yes
Key
Fixed value: mediabucket.
String
Yes
ci-process
Operation type, which is fixed at videoinfo.
String
Yes

Callback function description

function(err, data) { ... }
Parameter
Description
Type
err
The object returned when an error (network error or service error) occurs. If the request is successful, this parameter is empty. For more information, see Error Codes.
Object
- statusCode
Returned HTTP status code, such as 200, 403, and 404.
Number
- headers
Returned headers.
Object
data
The object returned when the request is successful. If an error occurs with the request, this parameter is empty.
Object
- statusCode
Returned HTTP status code, such as 200, 403, and 404.
Number
- headers
Returned headers.
Object
- RequestId
Unique ID of the request.
String
- Response
Response result.
Object
- - MediaInfo
Media details.
Object
- - - Stream
Stream information.
Object
- - - - Video
Video information.
Container
- - - - - Index
Stream number.
Number
- - - - - CodecName
Codec format name.
String
- - - - - CodecLongName
Detailed name of the codec format
String
- - - - - CodecTimeBase
Codec timebase.
String
- - - - - CodecTagString
Codec tag name.
String
- - - - - CodecTag
Codec tag.
String
- - - - - Profile
Video codec profile.
String
- - - - - Height
Video height in px.
Number
- - - - - Width
Video width in px.
Number
- - - - - HasBFrame
Whether B-frames exist. 1: yes; 0: no.
Number
- - - - - RefFrames
Number of reference frames for video codec.
Number
- - - - - Sar
Sample aspect ratio.
String
- - - - - Dar
Display aspect ratio.
String
- - - - - PixFormat
Pixel format.
String
- - - - - FieldOrder
Field order.
String
- - - - - Level
Video codec level.
Number
- - - - - Fps
Video frame rate.
Number
- - - - - AvgFps
Average frame rate.
String
- - - - - Timebase
Timebase.
String
- - - - - StartTime
Video start time in seconds.
Number
- - - - - Duration
Video duration in seconds.
Number
- - - - - Bitrate
Bitrate in Kbps.
Number
- - - - - NumFrames
Total number of frames.
Number
- - - - - Language
Language.
String
- - - - Audio
Audio information.
Container
- - - - - Index
Stream number.
Number
- - - - - CodecName
Codec format name.
String
- - - - - CodecLongName
Detailed name of the codec format.
String
- - - - - CodecTimeBase
Codec timebase.
String
- - - - - CodecTagString
Codec tag name.
String
- - - - - CodecTag
Codec tag.
String
- - - - - SampleFmt
Sample format.
String
- - - - - SampleRate
Sample rate.
Number
- - - - - Channel
Number of channels.
Number
- - - - - ChannelLayout
Channel layout.
String
- - - - - Timebase
Timebase.
String
- - - - - StartTime
Audio start time in seconds.
Number
- - - - - Duration
Audio duration in seconds.
Number
- - - - - Bitrate
Bitrate in Kbps.
Number
- - - - - Language
Language.
String
- - - - Subtitle
Subtitles information.
Container
- - - - - Index
Stream number.
Number
- - - - - Language
Language. und indicates no query result.
String
- - - Format
Format information.
Object
- - - - NumStream
Number of streams (including videos, audios, and subtitles).
Number
- - - - NumProgram
Number of programs.
Number
- - - - FormatName
Container format name.
String
- - - - FormatLongName
Detailed name of the container format.
String
- - - - StartTime
Start time in seconds.
Number
- - - - Duration
Duration in seconds.
Number
- - - - Bitrate
Bitrate in Kbps.
Number
- - - - Size
Size in bytes.
Number

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan