tencent cloud

Cloud Infinite

Media Screenshot APIs

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-02-29 16:13:43

Overview

This document provides an overview of APIs and SDK code samples for media screenshot.
API
Operation
Description
Querying screenshot
Query the screenshot of media file at some time point

Querying Screenshot

Feature description

This API is used to get a screenshot of a media file at some time point and put the screenshot information in a local file.

Method prototype

CosResult GetSnapshot(const GetSnapshotReq& request, GetSnapshotResp* response);

Sample code

qcloud_cos::CosConfig config("./config.json");
qcloud_cos::CosAPI cos(config);
GetSnapshotReq req(bucket_name, object_name, local_file);
GetSnapshotResp resp;
req.SetTime(100);
// Set the screenshot width
// req.SetWitdh(xxx);
// Set the screenshot height
// req.SetHeight(xxx);
// Set the format
// req.SetFormat(xxx);
CosResult result = cos.GetSnapshot(req, &resp);
if (result.IsSucc()) {
// The call is successful. You can call the `resp` member functions to get the return content.
} else {
// The call failed. You can call the `result` member functions to get the error information.
}

Parameter description

Parameter
Description
Type
Required
request
Operation request.
GetSnapshotReq
Yes
response
Operation response.
GetSnapshotResp
Yes

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백