用FFmpeg API采集摄像头视频和麦克风音频

上传者: love543814 | 上传时间: 2024-05-27 21:15:50 | 文件大小: 22.75MB | 文件类型: RAR
之前一直用Directshow技术采集摄像头数据,但是觉得涉及的细节比较多,要开发者比较了解Directshow的框架知识,学习起来有一点点难度。最近发现很多人问怎么用FFmpeg采集摄像头图像,事实上FFmpeg很早就支持通过DShow获取采集设备(摄像头、麦克风)的数据了,只是网上提供的例子比较少。如果能用FFmpeg实现采集、编码和录制(或推流),那整个实现方案就简化很多,正因为这个原因,我想尝试做一个FFmpeg采集摄像头视频和麦克风音频的程序。经过一个星期的努力,终于做出来了。我打算把开发的心得和经验分享给大家。我分三部分来讲述:首先第一部分介绍如何用FFmpeg的官方工具(ffmpeg.exe)通过命令行来枚举DShow设备和采集摄像头图像,这部分是基础,能够快速让大家熟悉怎么用FFmpeg测试摄像头采集;第二部分介绍我写的采集程序的功能和用法;第三部分讲解各个模块包括采集、编码、封装和录制是如何实现的。

文件下载

资源详情

[{"title":"( 162 个子文件 22.75MB ) 用FFmpeg API采集摄像头视频和麦克风音频","children":[{"title":"NSPlayer.aps <span style='color:#111;'> 64.51KB </span>","children":null,"spread":false},{"title":"AVOutputStream.cpp <span style='color:#111;'> 18.66KB </span>","children":null,"spread":false},{"title":"AVInputStream.cpp <span style='color:#111;'> 12.08KB </span>","children":null,"spread":false},{"title":"MainFrm.cpp <span style='color:#111;'> 11.26KB </span>","children":null,"spread":false},{"title":"ImagePainter.cpp <span style='color:#111;'> 6.58KB </span>","children":null,"spread":false},{"title":"SelectCaptureDeviceDlg.cpp <span style='color:#111;'> 4.33KB </span>","children":null,"spread":false},{"title":"StatisticsViewDlg.cpp <span style='color:#111;'> 2.74KB </span>","children":null,"spread":false},{"title":"NSPlayer.cpp <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false},{"title":"VideoDisplayWnd.cpp <span style='color:#111;'> 1.46KB </span>","children":null,"spread":false},{"title":"PProfile.cpp <span style='color:#111;'> 1.37KB </span>","children":null,"spread":false},{"title":"ChildView.cpp <span style='color:#111;'> 772B </span>","children":null,"spread":false},{"title":"stdafx.cpp <span style='color:#111;'> 137B </span>","children":null,"spread":false},{"title":"mt.dep <span style='color:#111;'> 60B </span>","children":null,"spread":false},{"title":"avcodec-56.dll <span style='color:#111;'> 18.74MB </span>","children":null,"spread":false},{"title":"avformat-56.dll <span style='color:#111;'> 5.57MB </span>","children":null,"spread":false},{"title":"avfilter-5.dll <span style='color:#111;'> 2.21MB </span>","children":null,"spread":false},{"title":"avdevice-56.dll <span style='color:#111;'> 1.30MB </span>","children":null,"spread":false},{"title":"avutil-54.dll <span style='color:#111;'> 441.50KB </span>","children":null,"spread":false},{"title":"swscale-3.dll <span style='color:#111;'> 436.50KB </span>","children":null,"spread":false},{"title":"swresample-1.dll <span style='color:#111;'> 264.00KB </span>","children":null,"spread":false},{"title":"postproc-53.dll <span style='color:#111;'> 118.50KB </span>","children":null,"spread":false},{"title":"EnumDevice.dll <span style='color:#111;'> 90.00KB </span>","children":null,"spread":false},{"title":"AVCaptureStream.exe <span style='color:#111;'> 552.50KB </span>","children":null,"spread":false},{"title":"avcodec.h <span style='color:#111;'> 175.60KB </span>","children":null,"spread":false},{"title":"avformat.h <span style='color:#111;'> 100.10KB </span>","children":null,"spread":false},{"title":"opt.h <span style='color:#111;'> 36.78KB </span>","children":null,"spread":false},{"title":"pixfmt.h <span style='color:#111;'> 31.85KB </span>","children":null,"spread":false},{"title":"frame.h <span style='color:#111;'> 23.16KB </span>","children":null,"spread":false},{"title":"swresample.h <span style='color:#111;'> 18.78KB </span>","children":null,"spread":false},{"title":"avio.h <span style='color:#111;'> 18.43KB </span>","children":null,"spread":false},{"title":"intreadwrite.h <span style='color:#111;'> 17.92KB </span>","children":null,"spread":false},{"title":"avdevice.h <span style='color:#111;'> 16.25KB </span>","children":null,"spread":false},{"title":"mem.h <span style='color:#111;'> 14.47KB </span>","children":null,"spread":false},{"title":"old_pix_fmts.h <span style='color:#111;'> 14.07KB </span>","children":null,"spread":false},{"title":"pixdesc.h <span style='color:#111;'> 13.82KB </span>","children":null,"spread":false},{"title":"common.h <span style='color:#111;'> 13.65KB </span>","children":null,"spread":false},{"title":"avstring.h <span style='color:#111;'> 12.67KB </span>","children":null,"spread":false},{"title":"swscale.h <span style='color:#111;'> 11.92KB </span>","children":null,"spread":false},{"title":"old_codec_ids.h <span style='color:#111;'> 10.37KB </span>","children":null,"spread":false},{"title":"log.h <span style='color:#111;'> 10.22KB </span>","children":null,"spread":false},{"title":"samplefmt.h <span style='color:#111;'> 9.97KB </span>","children":null,"spread":false},{"title":"buffer.h <span style='color:#111;'> 9.54KB </span>","children":null,"spread":false},{"title":"channel_layout.h <span style='color:#111;'> 8.86KB </span>","children":null,"spread":false},{"title":"avutil.h <span style='color:#111;'> 8.43KB </span>","children":null,"spread":false},{"title":"imgutils.h <span style='color:#111;'> 8.13KB </span>","children":null,"spread":false},{"title":"_mingw.h <span style='color:#111;'> 7.72KB </span>","children":null,"spread":false},{"title":"dict.h <span style='color:#111;'> 7.67KB </span>","children":null,"spread":false},{"title":"bprint.h <span style='color:#111;'> 7.61KB </span>","children":null,"spread":false},{"title":"parseutils.h <span style='color:#111;'> 7.08KB </span>","children":null,"spread":false},{"title":"vdpau.h <span style='color:#111;'> 6.93KB </span>","children":null,"spread":false},{"title":"version.h <span style='color:#111;'> 6.19KB </span>","children":null,"spread":false},{"title":"xvmc.h <span style='color:#111;'> 5.92KB </span>","children":null,"spread":false},{"title":"stdint.h <span style='color:#111;'> 5.73KB </span>","children":null,"spread":false},{"title":"inttypes.h <span style='color:#111;'> 5.59KB </span>","children":null,"spread":false},{"title":"error.h <span style='color:#111;'> 5.34KB </span>","children":null,"spread":false},{"title":"vda.h <span style='color:#111;'> 5.31KB </span>","children":null,"spread":false},{"title":"timecode.h <span style='color:#111;'> 5.20KB </span>","children":null,"spread":false},{"title":"eval.h <span style='color:#111;'> 5.18KB </span>","children":null,"spread":false},{"title":"mathematics.h <span style='color:#111;'> 5.06KB </span>","children":null,"spread":false},{"title":"fifo.h <span style='color:#111;'> 4.92KB </span>","children":null,"spread":false},{"title":"typedef.h <span style='color:#111;'> 4.91KB </span>","children":null,"spread":false},{"title":"cpu.h <span style='color:#111;'> 4.66KB </span>","children":null,"spread":false},{"title":"audio_fifo.h <span style='color:#111;'> 4.37KB </span>","children":null,"spread":false},{"title":"attributes.h <span style='color:#111;'> 4.13KB </span>","children":null,"spread":false},{"title":"rational.h <span style='color:#111;'> 4.09KB </span>","children":null,"spread":false},{"title":"vaapi.h <span style='color:#111;'> 3.91KB </span>","children":null,"spread":false},{"title":"version.h <span style='color:#111;'> 3.87KB </span>","children":null,"spread":false},{"title":"dv_profile.h <span style='color:#111;'> 3.68KB </span>","children":null,"spread":false},{"title":"stereo3d.h <span style='color:#111;'> 3.62KB </span>","children":null,"spread":false},{"title":"hash.h <span style='color:#111;'> 3.51KB </span>","children":null,"spread":false},{"title":"downmix_info.h <span style='color:#111;'> 3.16KB </span>","children":null,"spread":false},{"title":"display.h <span style='color:#111;'> 3.08KB </span>","children":null,"spread":false},{"title":"threadmessage.h <span style='color:#111;'> 3.05KB </span>","children":null,"spread":false},{"title":"avfft.h <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false},{"title":"hmac.h <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"Resource.h <span style='color:#111;'> 2.79KB </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 2.79KB </span>","children":null,"spread":false},{"title":"bswap.h <span style='color:#111;'> 2.79KB </span>","children":null,"spread":false},{"title":"crc.h <span style='color:#111;'> 2.72KB </span>","children":null,"spread":false},{"title":"timestamp.h <span style='color:#111;'> 2.55KB </span>","children":null,"spread":false},{"title":"file.h <span style='color:#111;'> 2.40KB </span>","children":null,"spread":false},{"title":"version.h <span style='color:#111;'> 2.33KB </span>","children":null,"spread":false},{"title":"dxva2.h <span style='color:#111;'> 2.30KB </span>","children":null,"spread":false},{"title":"vorbis_parser.h <span style='color:#111;'> 2.26KB </span>","children":null,"spread":false},{"title":"blowfish.h <span style='color:#111;'> 2.26KB </span>","children":null,"spread":false},{"title":"MainFrm.h <span style='color:#111;'> 2.22KB </span>","children":null,"spread":false},{"title":"avassert.h <span style='color:#111;'> 2.06KB </span>","children":null,"spread":false},{"title":"base64.h <span style='color:#111;'> 2.03KB </span>","children":null,"spread":false},{"title":"pixelutils.h <span style='color:#111;'> 2.02KB </span>","children":null,"spread":false},{"title":"lzo.h <span style='color:#111;'> 2.00KB </span>","children":null,"spread":false},{"title":"sha512.h <span style='color:#111;'> 1.98KB </span>","children":null,"spread":false},{"title":"ripemd.h <span style='color:#111;'> 1.98KB </span>","children":null,"spread":false},{"title":"version.h <span style='color:#111;'> 1.97KB </span>","children":null,"spread":false},{"title":"cast5.h <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"lfg.h <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false},{"title":"md5.h <span style='color:#111;'> 1.92KB </span>","children":null,"spread":false},{"title":"AVOutputStream.h <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"sha.h <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"xtea.h <span style='color:#111;'> 1.82KB </span>","children":null,"spread":false},{"title":"version.h <span style='color:#111;'> 1.82KB </span>","children":null,"spread":false},{"title":"......","children":null,"spread":false},{"title":"<span style='color:steelblue;'>文件过多,未全部展示</span>","children":null,"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明