All Products
Document Center

ApsaraVideo VOD:Live-to-VOD

Last Updated:May 19, 2022

This topic provides examples on how to use the API operations of the live-to-VOD module. The API operations are encapsulated in ApsaraVideo VOD SDK for C/C++. You can call the API operations to query live-to-VOD videos.

Initialize a client

Before you can use the SDK, initialize a client. For more information, see Initialization.

Query live-to-VOD videos

You can call the ListLiveRecordVideo operation to query live-to-VOD videos.

For more information about the request and response parameters of this operation, see ListLiveRecordVideo. Example:

#include <stdio.h>
#include <string>
#include <map>
#include <jsoncpp/json/json.h>
#include "vod_sdk/openApiUtil.h"

/* Query live-to-VOD videos. */
VodApiResponse listLiveRecordVideo(VodCredential authInfo) {
    string apiName = "ListLiveRecordVideo";
    map<string, string> args;
    args["StartTime"] = "2018-04-24T03:21:04Z";
    args["EndTime"] = "2018-05-21T03:21:44Z";
    args["StreamName"] = "testStream****";
    args["DomainName"] = "";
    args["AppName"] = "testApp****";
    return getAcsResponse(authInfo, apiName, args);

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
    VodApiResponse response = listLiveRecordVideo(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());