Windows 10 平台下编码 libav


注: 编译完成的文件可以从这里下载
参考:
[1]: https://libav.org/documentation/platform.html#Compilation-under-Cygwin
[2]: https://blog.csdn.net/wangpingfang/article/details/8133622

编码 libav

Centos 6.0 x86_64
命令 ./configure --prefix=/usr/local/libav/ --enable-shared --enable-gpl --enable-libx264 --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib --extra-libs=-ldl

windows10
命令 ./configure --target-os=mingw32 --arch=x86 --enable-shared --enable-static --enable-dxva2 --enable-gpl --enable-libx264 --enable-hwaccel=dxva2 --extra-cflags=-O3 --enable-pthreads

编译 ffmpeg

Centos 6.0 x86_64
命令 ./configure --enable-shared --prefix=/usr/local/ffmpeg --enable-gpl --enable-libx264 --extra-libs=-fPIC

遇到的问题:

问题1:“错误: ‘M_SQRT2’ 未声明”

解决方案:

  1. 在引用的 <math.h> 中增加下面的代码(不包含 #####…####),

     	###################### BEGIN #############################
     	#if defined(_USE_MATH_DEFINES) && !defined(_MATH_DEFINES_DEFINED)
     	#define _MATH_DEFINES_DEFINED
    
     	/* Define _USE_MATH_DEFINES before including math.h to expose these macro
     	 * definitions for common math constants.  These are placed under an #ifdef
     	 * since these commonly-defined names are not part of the C/C++ standards.
     	 */
    
     	/* Definitions of useful mathematical constants
     	 * M_E        - e
     	 * M_LOG2E    - log2(e)
     	 * M_LOG10E   - log10(e)
     	 * M_LN2      - ln(2)
     	 * M_LN10     - ln(10)
     	 * M_PI       - pi
     	 * M_PI_2     - pi/2
     	 * M_PI_4     - pi/4
     	 * M_1_PI     - 1/pi
     	 * M_2_PI     - 2/pi
     	 * M_2_SQRTPI - 2/sqrt(pi)
     	 * M_SQRT2    - sqrt(2)
     	 * M_SQRT1_2  - 1/sqrt(2)
     	 */
    
     	#define M_E 2.71828182845904523536
     	#define M_LOG2E 1.44269504088896340736
     	#define M_LOG10E 0.434294481903251827651
     	#define M_LN2 0.693147180559945309417
     	#define M_LN10 2.30258509299404568402
     	#define M_PI 3.14159265358979323846
     	#define M_PI_2 1.57079632679489661923
     	#define M_PI_4 0.785398163397448309616
     	#define M_1_PI 0.318309886183790671538
     	#define M_2_PI 0.636619772367581343076
     	#define M_2_SQRTPI 1.12837916709551257390
     	#define M_SQRT2 1.41421356237309504880
     	#define M_SQRT1_2 0.707106781186547524401
    
     	#endif /* _USE_MATH_DEFINES */
     	####################### END ############################
    
  2. Makefile 中需要在 CPPFLAGS 增加 -D_USE_MATH_DEFINES

参考链接:
[1]: https://blog.csdn.net/ssyitwin/article/details/83016844
[2]: https://bbs.csdn.net/topics/90353622?list=110995

问题2:“x264_bit_depth 未定义”

解决方案:

在头文件 x264_config.h 中增加 #define x264_bit_depth 0 (里面有 #define X264_BIT_DEPTH 0,猜测维护人员的编译环境是可以兼容大写的)

参考链接:
[1]: https://juejin.im/post/5d8acf83f265da5bb318d3a4

问题3: x264 not finded

解决方案

查看 config.log,可以看到解决办法的提示:

pkg-config --exists --print-errors x264
Package x264 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x264.pc'
to the PKG_CONFIG_PATH environment variable
Package 'x264', required by 'virtual:world', not found
ERROR: x264 not found

参考链接:
[1]: https://blog.csdn.net/jacke121/article/details/80352857
[2]: https://www.xuebuyuan.com/726320.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

顺水源心

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

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

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

打赏作者

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

抵扣说明:

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

余额充值