diff options
author | Sven Gothel <[email protected]> | 2020-07-20 04:51:17 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-04-20 06:45:16 +0200 |
commit | 0446de00adb980cf14bbe9886e494f09e72592ac (patch) | |
tree | c4a2ccf3385465fe105eeabc2146774b4c24c818 | |
parent | 74153176617f10ec4d8c59a8a98f895f2ea496a4 (diff) |
encavcodecInit/encavcodecaInit: Enable libav verbosity and show codec options if global_verbosity_level >= 3hw-encoder-base
-rw-r--r-- | libhb/encavcodec.c | 16 | ||||
-rw-r--r-- | libhb/encavcodecaudio.c | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index 278dc926e..a5acadaa4 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -753,6 +753,22 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job ) free(filename); } + if( 3 <= global_verbosity_level ) { + // Allow user to see av_opts in log file and see ffmpeg verbosity + int av_log_level = av_log_get_level(); + char * av_opts_string = NULL; + hb_log( "encavcodec: verbosity enabled: %d", global_verbosity_level); + if( 0 <= av_dict_get_string(av_opts, &av_opts_string, '=', ',') && NULL != av_opts_string ) { + hb_log( "encavcodec: avcodec_open options: %s", av_opts_string); + free(av_opts_string); + } else { + hb_log( "encavcodec: Error gathering avcodec_open options"); + } + if( AV_LOG_VERBOSE > av_log_level ) { + av_log_set_level(AV_LOG_VERBOSE); + } + } + if (hb_avcodec_open(context, codec, &av_opts, HB_FFMPEG_THREADS_AUTO)) { hb_log( "encavcodecInit: avcodec_open failed" ); diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c index 52fc4565d..839b1b66c 100644 --- a/libhb/encavcodecaudio.c +++ b/libhb/encavcodecaudio.c @@ -203,6 +203,22 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job) // packet instead. context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + if( 3 <= global_verbosity_level ) { + // Allow user to see av_opts in log file and see ffmpeg verbosity + int av_log_level = av_log_get_level(); + char * av_opts_string = NULL; + hb_log( "encavcodeca: verbosity enabled: %d", global_verbosity_level); + if( 0 <= av_dict_get_string(av_opts, &av_opts_string, '=', ',') && NULL != av_opts_string ) { + hb_log( "encavcodeca: avcodec_open options: %s", av_opts_string); + free(av_opts_string); + } else { + hb_log( "encavcodeca: Error gathering avcodec_open options"); + } + if( AV_LOG_VERBOSE > av_log_level ) { + av_log_set_level(AV_LOG_VERBOSE); + } + } + if (hb_avcodec_open(context, codec, &av_opts, 0)) { hb_error("encavcodecaInit: hb_avcodec_open() failed"); |