我用Python使用OpenCV,但实际上可以切换到C++,所以如果有问题,请考虑它回答问题。在
我正在写.avi文件(将多个avi文件合并为一个)
cv2.VideoWriter([filename, fourcc, fps, frameSize[, isColor]])
但是最近发现我不能用它来写大于2GB的.avi文件。它甚至提到:Due to this OpenCV for video containers supports only the avi extension, its first version. A direct limitation of this is that you cannot save a video file larger than 2 GB.
但是现在我没有时间去学习新的库,比如ffmpeg,我需要很快的学习。在
我如何使用C++或Python编写OpenCV,或者至少使用输入部分——使用
来编写这个文件 ^{pr2}$作为框架
你已经回答了你自己的问题,但我担心这不是你想要的答案。在
从你的链接
这一段说的是OpenCV的开发人员做出了一个设计选择,即您不能使用OpenCV编写大于2Gb的视频文件,具体原因是它是一个计算机视觉库,而不是一个视频工具。在
不幸的是,如果你想写大于2Gb的视频,你就需要学会使用FFMPEG或类似的东西(这并不难,而且与OpenCV有很好的绑定)
在opencv3.0中,由于引入了新的文件格式,如
.mkv
,这些格式确实支持大于2GB的视频文件,因此该限制被删除了。在见Does OpenCV 3.0 Still Has Limits On VideoWriter Size?。在
注意:文档和示例还没有更新,所以这应该被认为是实验性的。在
相关问题 更多 >
编程相关推荐