将单独的音频和视频文件组合成一个文件C ++ [英] combining separate audio and video files into one file C++

查看:216
本文介绍了将单独的音频和视频文件组合成一个文件C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用openCV的C ++项目。它是一个简单的网络摄像头应用程序,具有拍摄图片和视频等基本功能。我已经能够保存视频(w / o音频)。由于openCV不支持音频处理,我想知道是否有任何方式可以将音频分别记录在不同的文件中,然后将它们组合在一起以获得一个视频文件。
在互联网上搜索时,我听到有关使用带有openCV的ffmpeg的内容。但我只是不明白如何做到这一点.....



你们能帮我吗?我会非常感谢...谢谢!



P.S。我使用openCV和QT(GUI)

解决方案

正如你所说,opencv本身并不处理音频。但是,一旦您收到一个单独的音频和视频文件,您可以使用多路复用技术组合它们。有很多方法可以做到这一点。我使用的是 VirtualDub ,尽管它只是windows(不知道是否有问题)我知道ffmpeg也可以复用(通过命令行界面),我不记得命令是什么。还有mplayer和许多其他程序可以做到这一点。


I am working on a C++ project with openCV. It is a simple web cam application with basic features like capturing pictures and videos. I have already been able to save video (w/o audio). Since openCV doesnot support audio processing, I was wondering if there is any way I can record audio separately in a different file and later combine those together to get one video file. While searching on the internet, I did hear something about using ffmpeg with openCV. But I just cant figure out how to do it exactly.....

Can you guys help me? I would be very grateful... Thankyou!

P.S. I have used openCV and QT (for GUI)

解决方案

As you said, opencv doesn't by itself deal with audio. However once you get a separate audio and video file, you can combine them using a technique called muxing. There are many many ways to do this. I use VirtualDub for most of my muxing needs, although it is windows only (not sure if that's a problem). I know ffmpeg is also capable of muxing (via the command line interface), I can't recall what the command is. There's also mplayer and a multitude of other programs out there to do this.

这篇关于将单独的音频和视频文件组合成一个文件C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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