快速获取视频文件信息 - GetVideoInfoFromPath
函数简介
快速获取视频文件信息(无需打开整个视频)。
接口名称
GetVideoInfoFromPath
DLL调用
int64_t GetVideoInfoFromPath(int64_t instance, string videoPath);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| videoPath | 字符串 | 视频文件路径 |
示例
int64_t jsonPtr = GetVideoInfoFromPath(instance, "test.mp4");
if (jsonPtr != 0) {
printf("视频信息: %s\n", (char*)jsonPtr);
FreeStringPtr(instance, jsonPtr);
}
返回值
字符串指针,包含视频信息的 JSON 字符串,失败返回 0。
返回的字符串指针需要调用 FreeStringPtr 释放内存。
注意事项
- 此方法无需打开整个视频,速度较快
