ffmpeg#loglevel을 이용하여 로그 출력 정보를 제어합니다
int opt_loglevel(void *optctx, const char *opt, const char *arg)
{
const struct { const char *name; int level; } log_levels[] = {
{ "quiet" , AV_LOG_QUIET },
{ "panic" , AV_LOG_PANIC },
{ "fatal" , AV_LOG_FATAL },
{ "error" , AV_LOG_ERROR },
{ "warning", AV_LOG_WARNING },
{ "info" , AV_LOG_INFO },
{ "verbose", AV_LOG_VERBOSE },
{ "debug" , AV_LOG_DEBUG },
{ "trace" , AV_LOG_TRACE },
};
...
}
매크로에 대한 자세한 설명:
/**
* @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
/**
* Extremely verbose debugging, useful for libav* development.
*/
#define AV_LOG_TRACE 56
정의에서 알 수 있듯이 심각도가 점점 낮아지면서 다음과 같은 등급이 포함되어 있다. AV_LOG_PANIC, AV_LOG_FATAL, AV_LOG_ERROR, AV_LOG_WARNING, AV_LOG_INFO, AV_LOG_VERBOSE, AV_LOG_DEBUG. 각 레벨에 정의된 수치는 심각도를 나타내고, 수치가 작을수록 심각성을 나타냅니다.기본 레벨은 AV_LOG_INFO. 그 밖에 어떤 정보도 출력하지 않는 단계가 있다. 즉, AV_LOG_QUIET.
현재 시스템에는 Log 레벨이 있습니다.심각도가 이 수준보다 높은 모든 로그 정보가 출력됩니다.예를 들어 현재 Log 레벨은 AV_LOG_경고, AV_ 내보내기LOG_PANIC,AV_LOG_FATAL,AV_LOG_ERROR,AV_LOG_AV_를 내보내지 않고 WARNING 수준 정보LOG_INFO 수준의 정보.av_를 통해log_get_level() 현재 Log 레벨을 획득하여 다른 함수 av_log_set_level() 현재 Log 수준을 설정합니다.
ffmpeg -loglevel error -i sample.mp4 output.mkv
av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s
", errbuf);
...
int64_t seek_timestamp = timestamp;
...
av_log(NULL, AV_LOG_INFO, "seek_timestamp : %"PRId64"
",seek_timestamp);
...
uint64_t total_packets = 0, total_size = 0;
...
av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) demuxed
",
total_packets, total_size);
References:
https://blog.csdn.net/openswc/article/details/54694477 https://blog.csdn.net/leixiaohua1020/article/details/44243155
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.