获取视频基本信息 - GetVideoInfo
函数简介
获取视频基本信息(JSON格式)。
接口名称
GetVideoInfo
DLL调用
int64_t GetVideoInfo(int64_t instance, int64_t videoHandle);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| videoHandle | 长整数型 | 视频句柄 |
示例
int64_t jsonPtr = GetVideoInfo(instance, videoHandle);
if (jsonPtr != 0) {
printf("视频信息: %s\n", (char*)jsonPtr);
FreeStringPtr(instance, jsonPtr);
}
返回值
字符串指针,包含视频信息的 JSON 字符串(含 width, height, fps, totalFrames, duration, codecName, fileSize),失败返回 0。
返回的字符串指针需要调用 FreeStringPtr 释放内存。
