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

Video Frame Capturing

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-02-29 17:31:27

Overview

This document provides an overview of APIs and SDK code samples related to media file screen capturing in CI.
API
Operation
Description
GenerateSnapshot
Getting a screenshot of a media file at some time point
Gets a screenshot of a media file at some time point

Basic operations

Getting a screenshot of a media file at some time point

Feature description

This API is used to get a screenshot of a media file at some time point.

Method prototype

public SnapshotResponse generateSnapshot(SnapshotRequest request);

Parameter description

Parameter
Description
Type
Required
bucketName
Bucket name in the format of BucketName-APPID. For more information, see Bucket Overview.
String
Yes
Input
Media file location information.
Container
Yes
Time
Screenshot time point in seconds.
Float
Yes
Output
Screenshot storage location information.
Container
Yes
Width
Screenshot width. Default value: 0.
Int
No
Height
Screenshot height. Default value: 0. If Width and Height are both 0, the width and height of the video are used. If one of them is 0, the other value is used to automatically adapt to the aspect ratio of the video.
Int
No
Format
Screenshot format. Valid values: jpg, png. Default value: jpg.
String
No
Mode
Frame capturing method.
keyframe: Capture the last keyframe before the specified time point.
exactframe: Capture the frame at a specified time point. Default value: exactframe.
String
No
Rotate
Image rotation method.
auto: Rotate automatically according to the video rotation information.
off: Do not rotate. Default value: auto.
String
No
Input has the following sub-nodes:
Parameter
Parent Node
Description
Type
Required
Object
Request.Input
Filename
String
Yes
Output has the following sub-nodes:
Parameter
Parent Node
Description
Type
Required
Region
Request.Output
Bucket region
String
Yes
Bucket
Request.Output
File bucket
String
Yes
Object
Request.Output
Filename
String
Yes

Response description

Success: The screenshot entity information is returned.
Failure: An error (such as the bucket does not exist) occurs, throwing the CosClientException or CosServiceException exception. For more information, see Troubleshooting.

Sample request

//1. Create a screenshot request object
SnapshotRequest request = new SnapshotRequest();
//2. Add request parameters as detailed in the API documentation
request.setBucketName("examplebucket-1250000000");
request.getInput().setObject("1.mp4");
request.getOutput().setBucket("examplebucket-1250000000");
request.getOutput().setRegion("ap-chongqing");
request.getOutput().setObject("test/1.jpg");
request.setTime("15");
//3. Call the API to get the screenshot response object
SnapshotResponse response = client.generateSnapshot(request);


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan