Skip to content
Search

FFmpeg:Logging

lastmod 2024-05-24created 2016-08-032 edits

FFmpeg log output settings

static void activex_av_log(const char *fmt, va_list vargs)
{
 char szMsg[512] = {0};
 vsprintf(szMsg, fmt, vargs);
 OutputDebugString("[activex_av_log]");
 OutputDebugString(szMsg);
}

static void av_log_output(void *ptr, int level, const char *fmt, va_list vargs)
{
 KLog log;
 static int print_prefix = 1;
 AVClass *avc = ptr ? *(AVClass**)ptr : NULL;
 if (level > av_log_get_level())
  return;
 if (print_prefix && avc)
  log.WriteFileLog("[%s @ %p]", avc->item_name(ptr), ptr);
 print_prefix = strstr(fmt, "\n") != NULL;
 activex_av_log(fmt, vargs);
 //http_vlog(fmt, vargs);
}

...
int level = av_log_get_level();    // 로그레벨 가져오기
av_log_set_level(99);    // 로그레벨 설정
av_log_set_callback(av_log_output);   // 로그출력 콜백함수 설정

Disable log message

In the command-line tool, use it as follows.

$ ffmpeg -loglevel quiet

For the library, use the av_log family of functions.

av_log_set_level(AV_LOG_QUIET);

See also

Favorite site

author Zer0 sitemap