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 Screenshot APIs

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2024-03-01 14:57:12

Overview

This document provides an overview of APIs and SDK code samples for media screenshot.
Note:
The COS Python SDK version must be at least v5.1.9.11.
API
Operation
Description
Querying screenshot
Query the screenshot of media file at some time point
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. For more information, see Enabling Media Processing.

Querying Screenshot

Feature description

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

Method prototype

def get_snapshot(Bucket, Key, Time, Width=None, Height=None, Format='jpg', Rotate='auto', Mode='exactframe', **kwargs)

Sample request

response = client.get_snapshot(
Bucket='examplebucket-1250000000',
Key='demo.mp4',
Time='1.5',
Width='480',
Format='png'
)
print(response)
response['Body'].get_stream_to_file('snapshot.jpg')

Parameter description

Parameter
Description
Required
Type
Bucket
Bucket name in the format of BucketName-APPID. For more information, see Bucket Overview.
Yes
String
Key
Object key, which is the unique identifier of the object in the bucket.
Yes
String
Time
Screenshot time point in seconds, which can contain a decimal point.
Yes
String
Width
Screenshot width. Default value: 0.
No
String
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.
No
String
Format
Screenshot format. Valid values: jpg, png. Default value: jpg.
No
String
Rotate
Image rotation method. auto: Rotate automatically according to the video rotation information. off: Do not rotate. Default value: auto.
No
String
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.
No
String

Ajuda e Suporte

Esta página foi útil?

comentários