检测视频中的场景变化点 - DetectSceneChanges
函数简介
检测视频中的场景变化点。
接口名称
DetectSceneChanges
DLL调用
int64_t DetectSceneChanges(int64_t instance, string videoPath, double threshold)
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| videoPath | 字符串 | 视频文件路径 |
| threshold | 双精度 | 场景变化阈值(0-1) |
示例
int64_t instance = CreateCOLAPlugInterFace();
int64_t jsonPtr = DetectSceneChanges(instance, "test.mp4", 0.3);
if (jsonPtr != 0) {
printf("场景变化帧索引: %s\n", (char*)jsonPtr);
// JSON格式:[0, 123, 456, ...]
FreeStringPtr(instance, jsonPtr);
}
DestroyCOLAPlugInterFace(instance);
返回值
返回场景变化帧索引的JSON数组字符串,需调用FreeStringPtr释放;失败返回0。
JSON格式:[0, 123, 456, ...]
注意事项
- 返回的字符串指针必须调用 FreeStringPtr 释放内存
