ffmpeg之将av_log,av_log_set_level的用法和意义

AV_LOG: // 该函数是打印ffmpeg中的日志.

AV_LOG_SET_LEVEL: //这个函数是用来设置日志的标准, 其意义是指: 设置日志打印的标准, 高于这个标准的将不会打印

 

Example:

  #include <stdio.h>

#include <stdlib.h>

extern "C"

{

#include <libavformat\avformat.h>

#include <libavutil\avutil.h>

#include <libavcodec\avcodec.h>

}

#pragma comment(lib,"avutil.lib")

#pragma comment(lib,"avcodec.lib")

#pragma comment(lib,"avformat.lib")

int main(int argc, char* argv[])

{

const char* op = NULL;

int ret = -1;

av_log_set_level(AV_LOG_DEBUG);

av_log(NULL, AV_LOG_DEBUG, "hello,my name is ysd !");

av_log(NULL, AV_LOG_ERROR, "错误了!\n");

av_log(NULL, AV_LOG_TRACE, "我是不会被打印出来的");

system("pause");

return 0;

}

 

以下是比AV_LOG_DEBUG等级低的日志标准,  

 

/**

 * @addtogroup lavu_log

 *

 * @{

 *

 * @defgroup lavu_log_constants Logging Constants

 *

 * @{

 */

 

/**

 * Print no output.

 */

#define AV_LOG_QUIET    -8

 

/**

 * Something went really wrong and we will crash now.

 */

#define AV_LOG_PANIC     0

 

/**

 * Something went wrong and recovery is not possible.

 * For example, no header was found for a format which depends

 * on headers or an illegal combination of parameters is used.

 */

#define AV_LOG_FATAL     8

 

/**

 * Something went wrong and cannot losslessly be recovered.

 * However, not all future data is affected.

 */

#define AV_LOG_ERROR    16

 

/**

 * Something somehow does not look correct. This may or may not

 * lead to problems. An example would be the use of '-vstrict -2'.

 */

#define AV_LOG_WARNING  24

 

/**

 * Standard information.

 */

#define AV_LOG_INFO     32

 

/**

 * Detailed information.

 */

#define AV_LOG_VERBOSE  40

 

/**

 * Stuff which is only useful for libav* developers.

 */

#define AV_LOG_DEBUG    48

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值