tencent cloud


Media Screenshot APIs

Last updated: 2022-05-24 16:41:41


    This document provides an overview of APIs and SDK code samples for media screenshot.

    API Operation Description
    GetSnapshot 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;
    // 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
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support