ffplay,ffplay_g与enable-debug

一. ffmpeg debug level设置及configure enable-debug选项含义

./configure --help
Developer options (useful when working on FFmpeg itself):
--disable-debug disable debugging symbols
--enable-debug=LEVEL set the debug level [$debuglevel]

--enable-debug=LEVEL是用来控制编译器比如gcc的debug level选项的,不是控制ffmpeg的debug level选项的;
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

gcc -g option flag
gcc -g generates debug information to be used by GDB debugger.
option description
-g0 no debug information
-g1 minimal debug information
-g default debug information
-g3 maximal debug information

http://ffmpeg-users.933282.n4.nabble.com/enable-debug-level-td937399.html
--enable-debug=LEVEL sets the debugging level for the compilation command,
that is it will add to it the flag: -g LEVEL.
The meaning of that flag partly depends on the compiler used, for
example check the man page for gcc if you're using that.
Also if you want to debug ffmpeg the tool, it's better to use ffmpeg_g
which contains all the debugging symbols which are stripped away from
ffmpeg (the same is valid for the other tools as well).

./configure --enable-debug=trace
config.log
debug='yes'
debuglevel='trace'
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I/home/cd008/ffmpeg/ffmpeg-3.1.6/ffmpeg_build/include -std=c99 -fomit-frame-pointer -fPIC -pthread -gtrace -Wdisabled-optimization -c -o /tmp/ffconf.q0MBtMor.o /tmp/ffconf.f8qn68cn.c
cc1: error: unrecognised debug output level "trace"

libavutil/log.c
libavutil/log.h
控制ffmpeg的debug level选项是在libavutil/log.c中控制的,有多种方式可以设置ffmpeg的debug level等级;
1.在命令中控制loglevel
./ffplay -loglevel 56 -rtsp_transport udp rtsp://192.168.1.88 //56 -- AV_LOG_TRACE
2.在函数代码中调用av_log_set_level设置ffmpeg log debug level
ffmpeg_log_level = av_log_get_level();
printf("ffmpeg_log_level is %d.\n", ffmpeg_log_level);
av_log_set_level(AV_LOG_INFO); //AV_LOG_TRACE //AV_LOG_DEBUG

3.在libavutil/log.c中初始化中设定ffmpeg log debug level
static int av_log_level = AV_LOG_INFO; //AV_LOG_TRACE //AV_LOG_DEBUG


What do the ffmpeg loglevels mean?
FFmpeg has several loglevels (see -loglevel). These are, in order: quiet, panic, fatal, error, warning, info, verbose and debug.
But the documentation is not very verbose with explaining their meanings.
It's true that all names are self-documenting enough so they give some intuitive sense for when to use them. But when in doubt, from the user as well as the developer's perspective, in decision situations, it would help to have a clear definition of each level.
I would like to know which one is for what purpose, in order to know when to use them. I couldn't find any more hints on this. Especially on the difference between panic, fatal, error and info, verbose, debug.
Often the definitions of RFC 5424 (syslog protocol) are used. Wikipedia defines this severity levels like this:

Panic System is unusable. A "panic" condition usually affecting multiple apps/servers/sites. At this level it would usually notify all tech staff on call.

Alert Action must be taken immediately. Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection.

Critical Critical conditions. Should be corrected immediately, but indicates failure in a primary system, an example is a loss of a backup ISP connection.

Error Error conditions. Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time.

Warning Warning conditions. Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time.

Notice Normal but significant condition. Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required.

Informational Informational messages. Normal operational messages - may be harvested for reporting, measuring throughput, etc. - no action required.

Debug Debug-level messages. Info useful to developers for debugging the application, not useful during operations.

http://en.wikipedia.org/wiki/Syslog#Severity_levels

This are some common levels and there definition. FFmpeg does not make use of all of them and names some differently. But it will give you a clou...
There is no "notice" level, when trying to use it, you get: Invalid loglevel "notice". Possible levels are numbers or: "quiet" "panic" "fatal" "error" "warning" "info" "verbose" "debug" "trace"

 

二. ffplay与ffplay_g的区别
编译之后我们可以发现,文件夹中同时出现了ffplay与ffplay_g(还有ffmpeg与ffmpeg_g)。这个多出来的g是做什么的呢?实际上,ffplay_g是含有调试信息的可执行文件,当我们想要调试时(比如新建一个工程对源码进行调试)会需要到它,而一般来说在实际使用的时候,我们会使用ffplay,它是ffplay_g经过strip之后得到的文件,这就是他们的区别。
 

https://blog.csdn.net/openswc/article/details/54694477 

https://blog.csdn.net/weixin_42995417/article/details/82181190 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值