VS2013+FFMPEG开发环境配置

官网:https://ffmpeg.zeranoe.com/builds/


包含三个版本:Static、Shared以及Dev
Static   --- 包含3个应用程序:ffmpeg.exe , ffplay.exe , ffprobe.exe,体积都很大,相关的DLL已经被编译到exe里面去了。
Shared --- 除了ffmpeg.exe , ffplay.exe , ffprobe.exe之外还有一些DLL,exe体积很小,在运行时到相应的DLL中调用功能。
Dev      --- 开发者(developer)版本,里面包含了库文件xxx.lib以及头文件xxx.h,这个版本不含exe文件


一般我们用到的是Shared(*.dll)和Dev(*.lib;*.h)。


1、打开 Visual Studio 2013,新建项目,选择 Visual C++ 中的 Win32 控制台应用程序,确定,完成。
2、进入 FFmpeg 源码文件夹下的 doc/examples 文件夹,找到 metadata.c 文件,该文件是一个独立 demo,运行结果为打印音视频媒体文件基本信息。打开将其中的内容复制并粘贴到 ffmpeg-test.cpp 中,稍微修改如下。
3、在 Visual Studio 中的项目名上右击,打开属性,分别设置 配置属性 -> C/C++ -> 附加包含目录 和 配置属性 -> 链接器 -> 附加库目录 为第二步解压好的 32-bit Dev 文件夹下的 include 文件夹和 lib 文件夹,同时在 配置属性 -> 链接器 -> 输入 -> 附加依赖项 添加 avformat.lib 和 avutil.lib。
4、再将第二步解压的 32-bit Shared 文件夹下的 bin 文件夹中的 avcodec-56.dll、avformat-56.dll、avutil-54.dll 和 swresample-1.dll 拷贝到与解决方案同名的项目文件夹中。最终的文件结构如下图。

在VS2013环境下编译出现:


这是由于该函数被标记为attribute_deprecated,意味着该函数在不久的将来会被淘汰。

解决:1、将SDL检查关闭(暂时的方法)

2、更改为新的函数(参考ffplay.c)


5、编译执行成功得到结果如下。



命令行下编译:

E:\MyDocument\Desktop\FFmpeg>tree /F
文件夹 PATH 列表
卷序列号为 32D1-7CF3
E:.
│  avcodec-55.dll
│  avcodec.lib
│  avdevice-55.dll
│  avdevice.lib
│  avfilter-4.dll
│  avfilter.lib
│  avformat-55.dll
│  avformat.lib
│  avutil-52.dll
│  avutil.lib
│  ffmpeg.cpp
│  ffmpeg.exe
│  ffmpeg.obj
│  inttypes.h
│  postproc-52.dll
│  postproc.lib
│  stdint.h
│  swresample-0.dll
│  swresample.lib
│  swscale-2.dll
│  swscale.lib
│  _mingw.h

├─libavcodec
│      avcodec.h
│      avfft.h
│      dxva2.h
│      old_codec_ids.h
│      vaapi.h
│      vda.h
│      vdpau.h
│      version.h
│      xvmc.h

├─libavdevice
│      avdevice.h
│      version.h

├─libavfilter
│      asrc_abuffer.h
│      avcodec.h
│      avfilter.h
│      avfiltergraph.h
│      buffersink.h
│      buffersrc.h
│      version.h

├─libavformat
│      avformat.h
│      avio.h
│      version.h

├─libavutil
│      adler32.h
│      aes.h
│      attributes.h
│      audioconvert.h
│      audio_fifo.h
│      avassert.h
│      avconfig.h
│      avstring.h
│      avutil.h
│      base64.h
│      blowfish.h
│      bprint.h
│      bswap.h
│      buffer.h
│      channel_layout.h
│      common.h
│      cpu.h
│      crc.h
│      dict.h
│      downmix_info.h
│      error.h
│      eval.h
│      ffversion.h
│      fifo.h
│      file.h
│      frame.h
│      hmac.h
│      imgutils.h
│      intfloat.h
│      intfloat_readwrite.h
│      intreadwrite.h
│      lfg.h
│      log.h
│      lzo.h
│      macros.h
│      mathematics.h
│      md5.h
│      mem.h
│      murmur3.h
│      old_pix_fmts.h
│      opt.h
│      parseutils.h
│      pixdesc.h
│      pixfmt.h
│      random_seed.h
│      rational.h
│      replaygain.h
│      ripemd.h
│      samplefmt.h
│      sha.h
│      sha512.h
│      stereo3d.h
│      time.h
│      timecode.h
│      timestamp.h
│      version.h
│      xtea.h

├─libpostproc
│      postprocess.h
│      version.h

├─libswresample
│      swresample.h
│      version.h

└─libswscale
        swscale.h
        version.h




E:\MyDocument\Desktop\FFmpeg>


  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

N3verL4nd

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值