如何启用FFMPEG日志记录? [英] How to enable the FFMPEG logging?
本文介绍了如何启用FFMPEG日志记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想调试ffmpeg.我添加以下代码来打印日志:
I want to debug the ffmpeg. I add the following code to print logs:
av_log(s, AV_LOG_PANIC, fmt, ...)
或
printf("msg....")
但是它行不通.没有任何调试信息.
But it can't work. There isn't any debug information.
然后启用调试构建选项:
Then I enable the debug build option:
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-debug"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-debug=0"
它不起作用.
我确定添加跟踪的位置将被执行.
I'm sure that the place where I added the trace will be executed.
我只想打印一些简单的信息,怎么做?
I just want to print some simple informations, how to do it ?
推荐答案
我找到了解决方法:
void my_log_callback(void *ptr, int level, const char *fmt, va_list vargs)
{
vprintf(fmt, vargs);
}
设置日志级别并注册日志回调:
Set the log level and register the log callback:
av_log_set_level(AV_LOG_ERROR);
av_log_set_callback(my_log_callback);
这篇关于如何启用FFMPEG日志记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文