读取指定时间戳的帧 - ReadFrameAtTime
函数简介
读取指定时间戳的帧。
接口名称
ReadFrameAtTime
DLL调用
int64_t ReadFrameAtTime(int64_t instance, int64_t videoHandle, double timestamp);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| videoHandle | 长整数型 | 视频句柄 |
| timestamp | 双精度浮点数 | 时间戳(秒) |
示例
int64_t imageHandle = ReadFrameAtTime(instance, videoHandle, 5.5);
if (imageHandle != 0) {
printf("读取5.5秒处的帧成功\n");
}
返回值
长整数型:图像句柄(BGRA格式),失败返回 0。
注意事项
- 返回的图像句柄由内部管理,不需要手动释放
- timestamp 必须在视频时长范围内
