码迷,mamicode.com
首页 > 其他好文 > 详细

FFmpeg调用SDK实现日志的打印

时间:2019-12-31 10:58:05      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:debug   日志文件   eve   int   world   lib   %s   war   main   

日志文件的三大步

// 导入头文件
#include <libavutil/log.h>

// 设置日志级别
av_log_set_level(AV_LOG_DEBUG); //DEBUG以上的级别都打印出来

// 打印日志
av_log(NULL, AV_LOG_INFO, "...%s\n", op)  // op是打印出来的值

常用的日志级别

AV_LOG_ERROR  
AV_LOG_WARNING
AV_LOG_INFO
AV_LOG_DEBUG

例子

vim ffmpeg_log.c

#include <stdio.h>
#include <libavutil/log.h>

int main(int arc, char *argv[])
{
    // 设置级别
    av_log_set_level(AV_LOG_DEBUG);

    // 打印LOG
    av_log(NULL, AV_LOG_INFO, "Hello world%s\n", "123");

    return 0;
}

clang -g -o ffmpeg_log ffmpeg_log.c -lavutil

./ffmpeg_log

FFmpeg调用SDK实现日志的打印

标签:debug   日志文件   eve   int   world   lib   %s   war   main   

原文地址:https://www.cnblogs.com/fandx/p/12122987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!