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