ffmpeg编译保留代码不做优化

本文介绍了如何在编译ffmpeg时禁用-O3优化并启用调试信息。通过删除-O3选项并将其替换为-O0,可以确保源代码的完整性和便于调试。ffmpeg编译后显示了包含调试信息的版本详细信息,这有助于开发者进行问题排查和代码分析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

缺省是做-O3的优化,看config.mak文件。


CFLAGS=   -std=c11 -fomit-frame-pointer -pthread -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized

1)  delete the -O3

2) change -O3 to O0:


HOSTCFLAGS=  -std=c99 -Wall -O3



FFMPEG show the following messages:


ffmpeg version N-82982-gb7a6d28 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.1) 20160609
  configuration: --enable-debug=3 --disable-optimizations --disable-asm --disable-stripping
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 70.101 / 57. 70.101
  libavformat    57. 61.100 / 57. 61.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100





//参考了这个博客:

http://blog.youkuaiyun.com/glcdw/article/details/7258359

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值