2.4 Windows Conan编译FFmpeg 4.4.1

Windows下Conan编译及VSCode使用FFmpeg

Conan的安装与使用参考之前的文章:Conan简单使用

一、Conan编译ffmpeg

1.1 Conan的配置文件

创建配置文件:C:\Users\wujh\.conan2\profiles\vs2019

[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=192
os=Windows

解析说明:

设置项 说明
arch x86_64 目标架构为 64 位(x86_64)。
build_type Release 构建类型为 Release(优化模式,非调试)。
compiler msvc 使用 Microsoft Visual C++ 编译器。
compiler.cppstd 14 C++ 标准版本为 C++14。
compiler.runtime dynamic 使用动态运行时库(MD/MDd)。
compiler.version 192 MSVC 编译器版本,对应 Visual Studio 2019(版本号 192.x)。
os Windows 目标操作系统为 Windows。

1.2 在项目中创建conanfile.txt文件

查询库的版本:conancenter

conanfile.txt文件内容:

[requires]
ffmpeg/4.4.3

[options]
ffmpeg/*:shared=True
ffmpeg/*:with_libx264=True
ffmpeg/*:with_libx265=True
ffmpeg/*:with_libfdk_aac=True
ffmpeg/*:with_libmp3lame=True

ffmpeg/*:with_libvpx=False
ffmpeg/*:with_openjpeg=False
ffmpeg/*:with_openh264=False
ffmpeg/*:with_vorbis=False
ffmpeg/*:with_opus=False
ffmpeg/*:with_libwebp=False
ffmpeg/*:with_libaom=False
ffmpeg/*:with_ssl=False

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout

说明:

  • requires节下,指定库和其版本号。
  • options节下,指定库的选项
  • generators节,指定生成器设置
    • CMAkeDeps 生成库的查找文件 Findxxx.cmake
    • CMakeToolchain 配置工具链
  • layout节下,指定项目目录布局,cmake_layout标准的cmake项目目录结构

1.3 ffmpeg的Conan选项

分类 Conan 选项 对应 ./configure 参数 说明
FFmpeg 库 ffmpeg/*:shared=True --enable-shared / --disable-shared 编译动态库(True)或静态库(False)
ffmpeg/*:avdevice=True --enable-avdevice / --disable-avdevice 启用 FFmpeg 的设备处理模块
ffmpeg/*:avcodec=True --enable-avcodec / --disable-avcodec 启用 FFmpeg 的编解码模块
ffmpeg/*:avformat=True --enable-avformat / --disable-avformat 启用 FFmpeg 的封装/解封装模块
ffmpeg/*:swresample=True --enable-swresample / --disable-swresample 启用音频重采样模块
ffmpeg/*:swscale=True --enable-swscale / --disable-swscale 启用视频缩放和像素格式转换模块
ffmpeg/*:postproc=True --enable-postproc / --disable-postproc 启用视频后处理模块
ffmpeg/*:avfilter=True --enable-avfilter / --disable-avfilter 启用音视频过滤器模块
视频编码 ffmpeg/*:with_libx264=True --enable-libx264 / --disable-libx264 启用 H.264 编码支持(基于 libx264)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值