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