本项目主要演示了如何通过vfw获取视频 音频 然后使用ffmepg 压缩成MP4 并写文件。 主要代码放在了MP4lib项目里,与界面是分离的。 关于音视频同步问题,目前是调整视频的帧数解决的,如果使用时间戳,那么音频的dts(内有注释掉的代码)需要根据自己的 摄像头实际调整。
ffmpeg使用的是国人编译的 ffmpeg sdk。 界面部分也是使用的别人代码。
写这个DEMO的目的也是因为网上大部分的实例都是视频或者音频捕获写文件的实例,同时写入音频和视频的实例基本没看到。 希望这个实例能帮助大家。我自己从中学习不少关于FFMPEG 和视频音频的知识。
鸣谢: 1、感谢各路开源,和论坛的经验分享。看得资料太多记不得了。