From fd3538721cb1cabaa3fb88150c81e4c546c00a36 Mon Sep 17 00:00:00 2001 From: rigaya Date: Wed, 18 Oct 2023 18:09:15 +0900 Subject: [PATCH] =?UTF-8?q?--log-level=E3=81=ABquiet=E3=81=AB=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82=20(=20#527=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NVEnc/NVEnc_readme.txt | 6 ++++++ NVEncCore/rgy_cmd.cpp | 32 +++++++++++++++++++------------- NVEncCore/rgy_def.cpp | 10 ---------- NVEncCore/rgy_def.h | 2 -- NVEncCore/rgy_log.cpp | 2 +- NVEncCore/rgy_version.h | 6 +++--- configure | 8 ++++++++ 7 files changed, 37 insertions(+), 29 deletions(-) diff --git a/NVEnc/NVEnc_readme.txt b/NVEnc/NVEnc_readme.txt index 40508941..7693a96e 100644 --- a/NVEnc/NVEnc_readme.txt +++ b/NVEnc/NVEnc_readme.txt @@ -213,6 +213,12 @@ NVIDIA グラフィックドライバ 536.23 今後の更新で設定ファイルの互換性がなくなるかもしれません。 【メモ】 +2023.10.18 (7.34) +[NVEncC] +- 音声フィルターの切り替えがエンコード中に発生する時に--thread-audio > 1で異常終了する問題を修正。 +- --log-levelにquietを追加。 +- 新しいAVChannelLayout APIに対応(Windows版)。 + 2023.10.06 (7.33) [NVEncC] - NVEnc 7.32で10bit深度のy4m読みが異常終了する問題を修正。 diff --git a/NVEncCore/rgy_cmd.cpp b/NVEncCore/rgy_cmd.cpp index 861aebc6..50d0d9c9 100644 --- a/NVEncCore/rgy_cmd.cpp +++ b/NVEncCore/rgy_cmd.cpp @@ -3344,6 +3344,11 @@ int parse_log_level_param(const TCHAR *option_name, const TCHAR *arg_value, RGYP for (const auto& param : RGY_LOG_TYPE_STR) { paramList.push_back(tchar_to_string(param.second)); } + std::vector logLevelList; + for (const auto& param : RGY_LOG_LEVEL_STR) { + logLevelList.push_back({ param.second, param.first }); + } + logLevelList.push_back({ nullptr, 0 }); for (const auto ¶m : split(arg_value, _T(","))) { auto pos = param.find_first_of(_T("=")); @@ -3352,7 +3357,7 @@ int parse_log_level_param(const TCHAR *option_name, const TCHAR *arg_value, RGYP auto param_val = param.substr(pos + 1); param_arg = tolowercase(param_arg); int value = 0; - if (get_list_value(list_log_level, param_val.c_str(), &value)) { + if (get_list_value(logLevelList.data(), param_val.c_str(), &value)) { auto type_ret = std::find_if(RGY_LOG_TYPE_STR.begin(), RGY_LOG_TYPE_STR.end(), [param_arg](decltype(RGY_LOG_TYPE_STR[0])& type) { return param_arg == type.second; }); @@ -3364,16 +3369,16 @@ int parse_log_level_param(const TCHAR *option_name, const TCHAR *arg_value, RGYP return 1; } } else { - print_cmd_error_invalid_value(tstring(option_name) + _T(" ") + param_arg + _T("="), param_val, list_log_level); + print_cmd_error_invalid_value(tstring(option_name) + _T(" ") + param_arg + _T("="), param_val, logLevelList.data()); return 1; } } else { int value = 0; - if (get_list_value(list_log_level, param.c_str(), &value)) { + if (get_list_value(logLevelList.data(), param.c_str(), &value)) { loglevel.set((RGYLogLevel)value, RGY_LOGT_ALL); continue; } else { - print_cmd_error_invalid_value(option_name, arg_value, list_log_level); + print_cmd_error_invalid_value(option_name, arg_value, logLevelList.data()); return 1; } } @@ -5190,7 +5195,15 @@ int parse_one_ctrl_option(const TCHAR *option_name, const TCHAR *strInput[], int } i++; - auto parse_val = [option_name](RGYThreadAffinity& affinity, const tstring& param_arg, const tstring& param_val) { + std::array list_thread_affinity_mode; + for (size_t ia = 0; ia < RGY_THREAD_AFFINITY_MODE_STR.size(); ia++) { + list_thread_affinity_mode[ia].value = (int)RGY_THREAD_AFFINITY_MODE_STR[ia].second; + list_thread_affinity_mode[ia].desc = RGY_THREAD_AFFINITY_MODE_STR[ia].first; + } + list_thread_affinity_mode[RGY_THREAD_AFFINITY_MODE_STR.size()].value = 0; + list_thread_affinity_mode[RGY_THREAD_AFFINITY_MODE_STR.size()].desc = nullptr; + + auto parse_val = [option_name, &list_thread_affinity_mode](RGYThreadAffinity& affinity, const tstring& param_arg, const tstring& param_val) { if (param_val.substr(0, 2) == _T("0x")) { try { uint64_t affintyValue = std::strtoull(tchar_to_string(param_val).c_str(), nullptr, 16); @@ -5226,13 +5239,6 @@ int parse_one_ctrl_option(const TCHAR *option_name, const TCHAR *strInput[], int if (affinity_mode != RGYThreadAffinityMode::END) { affinity = RGYThreadAffinity(affinity_mode, affintyValue); } else { - std::array list_thread_affinity_mode; - for (size_t i = 0; i < RGY_THREAD_AFFINITY_MODE_STR.size(); i++) { - list_thread_affinity_mode[i].value = (int)RGY_THREAD_AFFINITY_MODE_STR[i].second; - list_thread_affinity_mode[i].desc = RGY_THREAD_AFFINITY_MODE_STR[i].first; - } - list_thread_affinity_mode[RGY_THREAD_AFFINITY_MODE_STR.size()].value = 0; - list_thread_affinity_mode[RGY_THREAD_AFFINITY_MODE_STR.size()].desc = nullptr; print_cmd_error_invalid_value(tstring(option_name) + _T(" ") + param_arg + _T("="), param_val, list_thread_affinity_mode.data()); return 1; } @@ -5263,7 +5269,7 @@ int parse_one_ctrl_option(const TCHAR *option_name, const TCHAR *strInput[], int return 1; } } else { - print_cmd_error_invalid_value(tstring(option_name) + _T(" ") + param_arg + _T("="), param_val, list_log_level); + print_cmd_error_invalid_value(tstring(option_name) + _T(" ") + param_arg + _T("="), param_val, list_thread_affinity_mode.data()); return 1; } } else { diff --git a/NVEncCore/rgy_def.cpp b/NVEncCore/rgy_def.cpp index 2385999d..274e7aa1 100644 --- a/NVEncCore/rgy_def.cpp +++ b/NVEncCore/rgy_def.cpp @@ -28,16 +28,6 @@ #include "rgy_def.h" #include "rgy_log.h" -const CX_DESC list_log_level[7] = { - { _T("trace"), RGY_LOG_TRACE }, - { _T("debug"), RGY_LOG_DEBUG }, - { _T("more"), RGY_LOG_MORE }, - { _T("info"), RGY_LOG_INFO }, - { _T("warn"), RGY_LOG_WARN }, - { _T("error"), RGY_LOG_ERROR }, - { NULL, 0 } -}; - tstring VideoVUIInfo::print_main() const { return tstring(_T("matrix:")) + get_cx_desc(list_colormatrix, matrix) + _T(",") + tstring(_T("colorprim:")) + get_cx_desc(list_colorprim, colorprim) + _T(",") diff --git a/NVEncCore/rgy_def.h b/NVEncCore/rgy_def.h index cf1239bf..9976789a 100644 --- a/NVEncCore/rgy_def.h +++ b/NVEncCore/rgy_def.h @@ -788,8 +788,6 @@ static bool is_list_empty(const CX_DESC *list) { return list[0].desc == nullptr; } -extern const CX_DESC list_log_level[]; - const CX_DESC list_avsync[] = { { _T("cfr"), RGY_AVSYNC_ASSUME_CFR }, { _T("vfr"), RGY_AVSYNC_VFR }, diff --git a/NVEncCore/rgy_log.cpp b/NVEncCore/rgy_log.cpp index 69edbd4c..4ec4e3b2 100644 --- a/NVEncCore/rgy_log.cpp +++ b/NVEncCore/rgy_log.cpp @@ -371,7 +371,7 @@ void RGYLog::write_log(RGYLogLevel log_level, const RGYLogType logtype, const TC std::string strHtml; for (uint32_t i = 0; i < strLines.size() - 1; i++) { - strHtml += strsprintf("
", tchar_to_string(list_log_level[log_level - RGY_LOG_TRACE].desc).c_str()); + strHtml += strsprintf("
", rgy_log_level_to_str(log_level)); strHtml += strLines[i]; strHtml += "
\n"; } diff --git a/NVEncCore/rgy_version.h b/NVEncCore/rgy_version.h index 96137cd8..730775f0 100644 --- a/NVEncCore/rgy_version.h +++ b/NVEncCore/rgy_version.h @@ -29,9 +29,9 @@ #ifndef __RGY_CONFIG_H__ #define __RGY_CONFIG_H__ -#define VER_FILEVERSION 0,7,33,0 -#define VER_STR_FILEVERSION "7.33" -#define VER_STR_FILEVERSION_TCHAR _T("7.33") +#define VER_FILEVERSION 0,7,34,0 +#define VER_STR_FILEVERSION "7.34" +#define VER_STR_FILEVERSION_TCHAR _T("7.34") #ifdef _M_IX86 #define BUILD_ARCH_STR _T("x86") diff --git a/configure b/configure index 83fe136b..d182eb51 100755 --- a/configure +++ b/configure @@ -123,6 +123,7 @@ CHECK_LIBAV_NAMES="libswresample libavutil libavcodec libavformat libavfilter li LIBAV_CFLAGS="" LIBAV_LIBS="" ENABLE_AVSW_READER=1 +AV_CHANNEL_LAYOUT_STRUCT_AVAIL=1 CHECK_VAPOURSYNTH_NAMES="vapoursynth vapoursynth-script" ENABLE_VAPOURSYNTH=1 @@ -493,6 +494,12 @@ if [ $ENABLE_AVSW_READER -ne 0 ]; then cnf_write "yes" fi + if ! cxx_check "AVChannelLayout" "${CXXFLAGS} ${EXTRACXXFLAGS} ${LIBAV_CFLAGS} ${LDFLAGS} ${EXTRALDFLAGS} ${LIBAV_LIBS}" "" "libavutil/channel_layout.h" "AVChannelLayout ch_layout;" ; then + cnf_write "no" + AV_CHANNEL_LAYOUT_STRUCT_AVAIL=0 + else + cnf_write "yes" + fi if ! cxx_check "libswresample" "${CXXFLAGS} ${EXTRACXXFLAGS} ${LIBAV_CFLAGS} ${LDFLAGS} ${EXTRALDFLAGS} ${LIBAV_LIBS}" "" "libswresample/swresample.h" "swr_alloc();" ; then cnf_write "no" ENABLE_AVSW_READER=0 @@ -733,6 +740,7 @@ write_enc_config "#define ENABLE_SM_READER 0" write_enc_config "#define ENABLE_LIBASS_SUBBURN $ENABLE_LIBASS" write_enc_config "#define ENABLE_VMAF $ENABLE_LIBVMAF" write_enc_config "#define ENABLE_AVCODEC_OUT_THREAD 1" +write_enc_config "#define AV_CHANNEL_LAYOUT_STRUCT_AVAIL $AV_CHANNEL_LAYOUT_STRUCT_AVAIL" write_enc_config "#define ENABLE_CPP_REGEX $ENABLE_CPP_REGEX" write_enc_config "#define ENABLE_DTL $ENABLE_DTL" write_enc_config "#define ENABLE_PERF_COUNTER 0"