在 OpenCV 中创建 AVI 文件 [英] Creating AVI files in OpenCV

查看:30
本文介绍了在 OpenCV 中创建 AVI 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用 OpenCV 和 Visual Studio 2008 创建一个应用程序,从网络摄像头捕获图像,对它们应用过滤器,然后将它们写入 AVI 文件.一切正常,除了创建 AVI 文件.

I have been trying to create an application using OpenCV and Visual Studio 2008, to capture images from a webcam, apply a filter to them, and then write them to an AVI file. Everything works, except creating the AVI file.

问题是它在我的电脑上能用,但在我同事的电脑上却不能用.这样做的原因(我认为)是他没有 OpenCV 使用所需的视频编码器.

The problem is that it works on my computer, but it doesn't work on my colleague's computer. The reason for that (I think) is that he does not have the necessary video encoders for OpenCV to use.

cvCreateVideoWriter 函数没有返回 NULL,但我最终在磁盘上得到了一个 0kb 的文件.

The cvCreateVideoWriter function does not return NULL, but I end up with a 0kb file on the disk.

推荐答案

问题是我的同事安装了旧版本的 OpenCV.如果我使用新的 OpenCV,它有一个编码器并且可以完成所有工作.

The problem was that my colleague had an older version of OpenCV installed. If I used the new OpenCV it had an encoder and it did all the work.

这篇关于在 OpenCV 中创建 AVI 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆