将当前帧转换为Base64字符串 - FrameToBase64
函数简介
将当前帧转换为Base64字符串。
接口名称
FrameToBase64
DLL调用
int64_t FrameToBase64(int64_t instance, int64_t videoHandle, string format);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| videoHandle | 长整数型 | 视频句柄 |
| format | 字符串 | 图片格式("png"、"jpg"等) |
示例
int64_t base64Ptr = FrameToBase64(instance, videoHandle, "png");
if (base64Ptr != 0) {
printf("Base64字符串: %s\n", (char*)base64Ptr);
FreeStringPtr(instance, base64Ptr);
}
返回值
字符串指针,Base64编码的图片数据,失败返回 0。
返回的字符串指针需要调用 FreeStringPtr 释放内存。
