从图片序列创建视频 - CreateVideoFromImages
函数简介
从图片序列创建视频。
接口名称
CreateVideoFromImages
DLL调用
int32_t CreateVideoFromImages(int64_t instance, string imageDir, string outputPath, double fps, string codec)
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| imageDir | 字符串 | 图片目录路径 |
| outputPath | 字符串 | 输出视频路径 |
| fps | 双精度 | 帧率 |
| codec | 字符串 | 编解码器("H264"等) |
示例
int64_t instance = CreateCOLAPlugInterFace();
int32_t result = CreateVideoFromImages(instance, "C:/images", "output.mp4", 30.0, "H264");
if (result == 1) {
printf("视频创建成功\n");
} else {
printf("视频创建失败\n");
}
DestroyCOLAPlugInterFace(instance);
返回值
- 0: 失败
- 1: 成功
注意事项
- 图片文件名应按字母顺序排列
