diff --git a/NVEnc/NVEnc.en.lng b/NVEnc/NVEnc.en.lng index 51bd0feb..f5d652e8 100644 --- a/NVEnc/NVEnc.en.lng +++ b/NVEnc/NVEnc.en.lng @@ -133,7 +133,21 @@ AUO_ERR_VIDENC_VERSION4=Version of exe file AUO_ERR_AFS_GET_FRAME=Failed to get frame from Aviutl. AUO_ERR_OPEN_WAVFILE=Failed to open wav file. AUO_ERR_NO_WAVFILE=Could not find wav file. Audio encoding has failed. -AUO_ERR_AUDIO_LENGTH_DIFFERENT1=Audio length seems to differ from video length. +AUO_ERR_AUDIO_LENGTH_EXEDIT1=Audio track in exedit and Aviutl might be conflicting. +AUO_ERR_AUDIO_LENGTH_EXEDIT2=In order to make audio from exedit active again, please abort output and +AUO_ERR_AUDIO_LENGTH_EXEDIT3=try switching scene in exedit, and retry output again. +AUO_ERR_AUDIO_LENGTH_EXEDIT4= (For example, switch scene to and from like "Root" ¨ "Scene1" ¨ "Root"). +AUO_ERR_AUDIO_LENGTH_EXEDIT5=However when audio samplerate in exedit is different from the original audio, +AUO_ERR_AUDIO_LENGTH_EXEDIT6=this problem may not be solved. +AUO_ERR_AUDIO_LENGTH_EXEDIT7=Please note that audio track should be read only in exedit when using exedit.\n +AUO_ERR_AUDIO_LENGTH_ZERO1=There is no audio data to be written (Audio length is zero).\n +AUO_ERR_AUDIO_LENGTH_ZERO2=If you do not intentionally output audio, please check "No audio" in the "Audio compression" box +AUO_ERR_AUDIO_LENGTH_ZERO3=at the bottom of the output file dialog of the plugin output. +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO1=Will you abort output? +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO2=[ Yes ] ... Abort output +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO3=[ No ] ... Ignore warning and continue output +AUO_ERR_AUDIO_LENGTH_DIFFERENT1=Audio length seems to differ from video length. (%.1f“ > %.1f“) +AUO_ERR_AUDIO_LENGTH_DIFFERENT1_2=Audio length seems to differ from video length. AUO_ERR_AUDIO_LENGTH_DIFFERENT2=Video: %d:%02d:%02d.%03d, Audio: %d:%02d:%02d.%03d AUO_ERR_AUDIO_LENGTH_DIFFERENT3=Audio length has been adjusted to match video length. AUO_ERR_AUDIO_LENGTH_DIFFERENT4=Audio track in exedit and Aviutl might be conflicting. diff --git a/NVEnc/NVEnc.ja.lng b/NVEnc/NVEnc.ja.lng index 9e51188c..b8aec0c1 100644 --- a/NVEnc/NVEnc.ja.lng +++ b/NVEnc/NVEnc.ja.lng @@ -132,7 +132,21 @@ AUO_ERR_VIDENC_VERSION4=実行ファイルã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ AUO_ERR_AFS_GET_FRAME=Aviutlã‹ã‚‰ã®ãƒ•ãƒ¬ãƒ¼ãƒ èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸã€‚ AUO_ERR_OPEN_WAVFILE=wavファイルã®ã‚ªãƒ¼ãƒ—ンã«å¤±æ•—ã—ã¾ã—ãŸã€‚ AUO_ERR_NO_WAVFILE=wavファイルãŒã¿ã¤ã‹ã‚Šã¾ã›ã‚“。音声エンコードã«å¤±æ•—ã—ã¾ã—ãŸã€‚ -AUO_ERR_AUDIO_LENGTH_DIFFERENT1=音声ã®é•·ã•ãŒæ˜ åƒã®é•·ã•ã¨ç•°ãªã‚‹ã‚ˆã†ã§ã™ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT1=拡張編集ã®éŸ³å£°ãƒˆãƒ©ãƒƒã‚¯ã¨Aviutl本体ã®éŸ³å£°ãƒˆãƒ©ãƒƒã‚¯ãŒç«¶åˆã—ã¦ã„ã¦ã€ +AUO_ERR_AUDIO_LENGTH_EXEDIT2=拡張編集å´ã§ç·¨é›†ã—ãŸéŸ³å£°ãŒå‡ºåŠ›ã•ã‚Œãšã€æ„図ã—ãŸéŸ³å£°å‡ºåŠ›ãŒã§ããªã„å¯èƒ½æ€§ãŒé«˜ã„ã§ã™ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT3=一度出力を中断ã—ã€é©å½“ã«æ‹¡å¼µç·¨é›†ã§ã‚·ãƒ¼ãƒ³åˆ‡ã‚Šæ›¿ãˆã‚’一度行ã£ã¦æˆ»ã—ãŸå¾Œã€å†å‡ºåŠ›ã™ã‚‹ã“ã¨ã§æ”¹å–„ã™ã‚‹å ´åˆãŒã‚ã‚Šã¾ã™ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT4=(例ãˆã°æ‹¡å¼µç·¨é›†ã®ã‚·ãƒ¼ãƒ³ã‚’ Root → Scene1 → Root ã®ã‚ˆã†ã«åˆ‡ã‚Šæ›¿ãˆã¦æˆ»ã™) +AUO_ERR_AUDIO_LENGTH_EXEDIT5=ãŸã ã€æ‹¡å¼µç·¨é›†å´ã®éŸ³å£°ã®ã‚µãƒ³ãƒ—リングレートã¨Aviutl本体å´ã®éŸ³å£°ã®ã‚µãƒ³ãƒ—リングレートãŒç•°ãªã‚‹å ´åˆã«ã¯ã€ +AUO_ERR_AUDIO_LENGTH_EXEDIT6=ã“ã‚Œã§è§£æ±ºã§ããªã„å ´åˆã‚‚ã‚ã‚Šã¾ã™ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT7=拡張編集使用時ã«ã¯ã€Aviutl本体ã®éŸ³å£°ãƒˆãƒ©ãƒƒã‚¯èª­ã¿è¾¼ã¿ã‚’使用ã—ãªã„よã†ã”注æ„ãã ã•ã„。\n +AUO_ERR_AUDIO_LENGTH_ZERO1=音声データãŒå­˜åœ¨ã—ãªã„ãŸã‚ã€ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‰ã‚’è¡Œãˆã¾ã›ã‚“。(é•·ã•ãŒ0ã§ã™)\n +AUO_ERR_AUDIO_LENGTH_ZERO2=æ„図的ã«éŸ³å£°ã®å‡ºåŠ›ã‚’è¡Œã‚ãªã„å ´åˆã«ã¯ã€ãƒ—ラグイン出力ã®å‡ºåŠ›ãƒ•ã‚¡ã‚¤ãƒ«åを指定ã™ã‚‹ç”»é¢ã®ä¸‹éƒ¨ã«ã‚ã‚‹ +AUO_ERR_AUDIO_LENGTH_ZERO3=「オーディオ圧縮ã€æ¬„ã«ã¦ã€ã€ŒéŸ³å£°ç„¡ã—ã€ã«ãƒã‚§ãƒƒã‚¯ã‚’入れã¦å‡ºåŠ›ã—ãªãŠã—ã¦ãã ã•ã„。 +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO1=出力を中断ã—ã¾ã™ã‹? +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO2=[ ã¯ã„  ] ... 出力を中断ã™ã‚‹ (推奨) +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO3=[ ã„ã„㈠] ... 警告を無視ã—ã¦å‡ºåŠ›ã‚’継続ã™ã‚‹ +AUO_ERR_AUDIO_LENGTH_DIFFERENT1=音声ã®é•·ã•ãŒæ˜ åƒã®é•·ã•ã¨ç•°ãªã‚‹ã‚ˆã†ã§ã™ã€‚(%.1fï¼… > %.1fï¼…) +AUO_ERR_AUDIO_LENGTH_DIFFERENT1_2=音声ã®é•·ã•ãŒæ˜ åƒã®é•·ã•ã¨ç•°ãªã‚‹ã‚ˆã†ã§ã™ã€‚ AUO_ERR_AUDIO_LENGTH_DIFFERENT2=映åƒ: %d:%02d:%02d.%03d, 音声: %d:%02d:%02d.%03d AUO_ERR_AUDIO_LENGTH_DIFFERENT3=音声ã®é•·ã•ãŒæ˜ åƒã®é•·ã•ã«ä¸€è‡´ã™ã‚‹ã‚ˆã†ã€è‡ªå‹•çš„ã«èª¿æ•´ã—ã¾ã—ãŸã€‚ AUO_ERR_AUDIO_LENGTH_DIFFERENT4=拡張編集ã®éŸ³å£°ãƒˆãƒ©ãƒƒã‚¯ã¨Aviutl本体ã®éŸ³å£°ãƒˆãƒ©ãƒƒã‚¯ãŒç«¶åˆã—ã¦ã„ã‚‹å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚ diff --git a/NVEnc/NVEnc.zh.lng b/NVEnc/NVEnc.zh.lng index a1a89f86..381cc637 100644 --- a/NVEnc/NVEnc.zh.lng +++ b/NVEnc/NVEnc.zh.lng @@ -132,7 +132,21 @@ AUO_ERR_VIDENC_VERSION4=å¯æ‰§è¡Œæ–‡ä»¶ç‰ˆæœ¬ AUO_ERR_AFS_GET_FRAME=无法从Aviutl中读å–到帧。 AUO_ERR_OPEN_WAVFILE=无法打开wav文件。 AUO_ERR_NO_WAVFILE=找ä¸åˆ°wav文件。音频编ç å¤±è´¥ã€‚ -AUO_ERR_AUDIO_LENGTH_DIFFERENT1=音频长度与视频长度ä¸åŒ¹é…。 +AUO_ERR_AUDIO_LENGTH_EXEDIT1=扩展编辑端音轨和Aviutl本体端音轨å¯èƒ½å­˜åœ¨å†²çªï¼Œ +AUO_ERR_AUDIO_LENGTH_EXEDIT2=扩展编辑端编辑的音频很å¯èƒ½æ— æ³•å¯¼å‡ºï¼Œç›®æ ‡éŸ³é¢‘也å¯èƒ½æ— æ³•æŒ‰é¢„期导出。 +AUO_ERR_AUDIO_LENGTH_EXEDIT3=中断导出,适当地切æ¢ä¸€æ¬¡æ‰©å±•ç¼–辑次åˆæˆï¼Œç„¶åŽé‡æ–°å¯¼å‡ºï¼Œæˆ–许能改善这ç§é—®é¢˜ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT4= (例如,在扩展编辑端进行如下切æ¢ï¼šä¸»åˆæˆ → 次åˆæˆ 1 → 主åˆæˆï¼‰ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT5=但如果扩展编辑端与Aviutl本体端的音频采样率ä¸åŒï¼Œ +AUO_ERR_AUDIO_LENGTH_EXEDIT6=该问题ä¸ä¸€å®šèƒ½å¤Ÿè§£å†³ã€‚ +AUO_ERR_AUDIO_LENGTH_EXEDIT7=请注æ„,ä¸è¦åœ¨ä½¿ç”¨æ‰©å±•ç¼–辑时,åŒæ—¶ä½¿ç”¨Aviutl本体自带的音轨读å–功能。\n +AUO_ERR_AUDIO_LENGTH_ZERO1=音频数æ®ä¸å­˜åœ¨ï¼Œæ— æ³•ç¼–ç ã€‚(长度为0)\n +AUO_ERR_AUDIO_LENGTH_ZERO2=è‹¥ä¸æƒ³å¯¼å‡ºéŸ³é¢‘,请在勾选å±å¹•åº•éƒ¨â€œéŸ³é¢‘压缩â€æ å³ä¾§çš„“ç¦ç”¨éŸ³é¢‘†+AUO_ERR_AUDIO_LENGTH_ZERO3=,以指定æ’件导出的导出文件å,然åŽé‡æ–°å¯¼å‡ºã€‚ +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO1=是å¦ä¸­æ­¢å¯¼å‡ºï¼Ÿ +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO2=[ 是 ] ... 中止导出 +AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO3=[ å¦ ] ... 忽略警告,继续导出。 +AUO_ERR_AUDIO_LENGTH_DIFFERENT1=音频长度与视频长度ä¸åŒ¹é…。 (%.1fï¼… > %.1fï¼…) +AUO_ERR_AUDIO_LENGTH_DIFFERENT1_2=音频长度与视频长度ä¸åŒ¹é…。 AUO_ERR_AUDIO_LENGTH_DIFFERENT2=视频: %d:%02d:%02d.%03d, 音频: %d:%02d:%02d.%03d AUO_ERR_AUDIO_LENGTH_DIFFERENT3=将自动调整音频长度以匹é…视频长度。 AUO_ERR_AUDIO_LENGTH_DIFFERENT4=扩展编辑音轨和Aviutl本体音轨å¯èƒ½å­˜åœ¨å†²çªã€‚ diff --git a/NVEnc/encode/auo_audio.cpp b/NVEnc/encode/auo_audio.cpp index 6ee0ba7e..ac3d6bc4 100644 --- a/NVEnc/encode/auo_audio.cpp +++ b/NVEnc/encode/auo_audio.cpp @@ -118,14 +118,42 @@ void auo_faw_check(CONF_AUDIO *aud, const OUTPUT_INFO *oip, PRM_ENC *pe, const g } } -void check_audio_length(OUTPUT_INFO *oip) { +int message_check_audio_length() { + std::wstring mes = g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT1_2) + std::wstring(L"\n\n"); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT1); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT2) + std::wstring(L"\n\n"); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT3); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT4) + std::wstring(L"\n\n"); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT5); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT6) + std::wstring(L"\n\n"); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO1) + std::wstring(L"\n"); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO2) + std::wstring(L"\n"); + mes += g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO3) + std::wstring(L"\n"); + return MessageBox(NULL, wstring_to_string(mes).c_str(), AUO_NAME, MB_ICONERROR | MB_YESNO) == IDYES ? 1 : 0; +} + +int check_audio_length(OUTPUT_INFO *oip, double av_length_threshold) { + if ((oip->flag & OUTPUT_INFO_FLAG_AUDIO) == 0) { + return 0; + } const double video_length = oip->n * (double)oip->scale / oip->rate; const double audio_length = oip->audio_n / (double)oip->audio_rate; if (video_length <= 1.0) { // 1秒未満ã¯ãƒã‚§ãƒƒã‚¯ã—ãªã„ - return; + return 0; + } + if (oip->audio_n == 0) { + const BOOL exedit_is_used = check_if_exedit_is_used(); + error_audio_length_zero(exedit_is_used); + if (oip->flag & OUTPUT_INFO_FLAG_BATCH) { // ãƒãƒƒãƒå‡ºåŠ›æ™‚ã¯å³ã‚¨ãƒ©ãƒ¼çµ‚了 + return 1; + } + return message_check_audio_length(); } + av_length_threshold = std::abs(av_length_threshold); + av_length_threshold = std::max(1e-4, av_length_threshold); + const double audio_ratio = audio_length / video_length; - if (!check_range(audio_ratio, 0.95, 1.05)) { // 5%以上 å·®ãŒã‚ã‚‹å ´åˆ + if (!check_range(audio_ratio, std::max(1.0 - av_length_threshold, 0.0), 1.0 + av_length_threshold)) { const BOOL exedit_is_used = check_if_exedit_is_used(); int selected_audio_rate = 0; if (exedit_is_used @@ -144,11 +172,19 @@ void check_audio_length(OUTPUT_INFO *oip) { } if (selected_audio_rate != 0) { oip->audio_n = (int)div_round((int64_t)oip->audio_n * (int64_t)oip->audio_rate, (int64_t)selected_audio_rate); - info_audio_length_changed(video_length, audio_length, exedit_is_used); + info_audio_length_changed(video_length, audio_length, exedit_is_used, av_length_threshold); } else { // 5%以上差ãŒã‚ã‚‹å ´åˆ - warning_audio_length(video_length, audio_length, exedit_is_used); + error_audio_length(video_length, audio_length, exedit_is_used, av_length_threshold); + // 拡張編集使用時ã«ã¯ã€æ„図ã—ãªã„出力ã§ã‚ã‚‹å¯èƒ½æ€§ãŒé«˜ãã€ã‚¨ãƒ©ãƒ¼çµ‚了ã•ã›ã‚‹ + if (exedit_is_used) { + if (oip->flag & OUTPUT_INFO_FLAG_BATCH) { // ãƒãƒƒãƒå‡ºåŠ›æ™‚ã¯å³ã‚¨ãƒ©ãƒ¼çµ‚了 + return 1; + } + return message_check_audio_length(); + } } } + return 0; } static void build_wave_header(BYTE *head, const int audio_ch, const int audio_rate, BOOL use_8bit, int sample_n) { diff --git a/NVEnc/encode/auo_audio.h b/NVEnc/encode/auo_audio.h index 20d83b52..5b621a64 100644 --- a/NVEnc/encode/auo_audio.h +++ b/NVEnc/encode/auo_audio.h @@ -38,7 +38,7 @@ void *get_audio_data(const OUTPUT_INFO *oip, PRM_ENC *pe, int start, int length, int *readed); void auo_faw_check(CONF_AUDIO *aud, const OUTPUT_INFO *oip, PRM_ENC *pe, const guiEx_settings *ex_stg); -void check_audio_length(OUTPUT_INFO *oip); +int check_audio_length(OUTPUT_INFO *oip, double av_length_threshold); AUO_RESULT audio_output(CONF_GUIEX *conf, const OUTPUT_INFO *oip, PRM_ENC *pe, const SYSTEM_DATA *sys_dat); //音声処ç†ã‚’実行 AUO_RESULT audio_output_parallel(CONF_GUIEX *conf, const OUTPUT_INFO *oip, PRM_ENC *pe, const SYSTEM_DATA *sys_dat); diff --git a/NVEnc/encode/auo_encode.cpp b/NVEnc/encode/auo_encode.cpp index cf4a8e0b..49977f56 100644 --- a/NVEnc/encode/auo_encode.cpp +++ b/NVEnc/encode/auo_encode.cpp @@ -552,7 +552,9 @@ BOOL check_output(CONF_GUIEX *conf, OUTPUT_INFO *oip, const PRM_ENC *pe, guiEx_s //音声エンコーダ if (oip->flag & OUTPUT_INFO_FLAG_AUDIO) { //音声長ã•ãƒã‚§ãƒƒã‚¯ - check_audio_length(oip); + if (check_audio_length(oip, exstg->s_local.av_length_threshold)) { + check = FALSE; + } if (conf->aud.use_internal) { CONF_AUDIO_BASE *cnf_aud = &conf->aud.in; diff --git a/NVEnc/frm/auo_error.cpp b/NVEnc/frm/auo_error.cpp index e6af88a4..5fe9e977 100644 --- a/NVEnc/frm/auo_error.cpp +++ b/NVEnc/frm/auo_error.cpp @@ -390,7 +390,23 @@ void error_no_wavefile() { write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_NO_WAVFILE)); } -static void message_audio_length_different(const double video_length, const double audio_length, const BOOL exedit_is_used, const BOOL audio_length_changed) { + +void error_audio_length_zero(const BOOL exedit_is_used) { + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_ZERO1)); + if (exedit_is_used) { + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT1)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT2)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT3)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT4)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT5)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT6)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT7)); + } + write_log_auo_line(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_ZERO2)); + write_log_auo_line(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_ZERO3)); +} + +static void message_audio_length_different(const double video_length, const double audio_length, const BOOL exedit_is_used, const double av_length_threshold, const BOOL audio_length_changed) { const int vid_h = (int)(video_length / 3600); const int vid_m = (int)(video_length - vid_h * 3600) / 60; const int vid_s = (int)(video_length - vid_h * 3600 - vid_m * 60); @@ -401,24 +417,36 @@ static void message_audio_length_different(const double video_length, const doub const int aud_s = (int)(audio_length - aud_h * 3600 - aud_m * 60); const int aud_ms = std::min((int)((audio_length - (double)(aud_h * 3600 + aud_m * 60 + aud_s)) * 1000.0), 999); + const double diff_ratio = std::abs(1.0 - (audio_length / video_length)); + if (audio_length_changed) { - write_log_auo_line( LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT1)); + write_log_auo_line_fmt(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT1), diff_ratio * 100.0, av_length_threshold * 100.0); write_log_auo_line_fmt(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT2), vid_h, vid_m, vid_s, vid_ms, aud_h, aud_m, aud_s, aud_ms); write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT3)); if (exedit_is_used) { - write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT4)); - write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT5)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT1)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT2)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT3)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT4)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT5)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT6)); + write_log_auo_line(LOG_INFO, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT7)); } } else { - write_log_auo_line( LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT1)); + write_log_auo_line_fmt(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT1), diff_ratio * 100.0, av_length_threshold * 100.0); write_log_auo_line_fmt(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT2), vid_h, vid_m, vid_s, vid_ms, aud_h, aud_m, aud_s, aud_ms); if (exedit_is_used) { - write_log_auo_line(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT4)); - write_log_auo_line(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT5)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT1)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT2)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT3)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT4)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT5)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT6)); + write_log_auo_line(LOG_ERROR, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_EXEDIT7)); } else { write_log_auo_line(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT6)); write_log_auo_line(LOG_WARNING, g_auo_mes.get(AUO_ERR_AUDIO_LENGTH_DIFFERENT7)); @@ -428,12 +456,12 @@ static void message_audio_length_different(const double video_length, const doub } } -void info_audio_length_changed(const double video_length, const double audio_length, const BOOL exedit_is_used) { - message_audio_length_different(video_length, audio_length, exedit_is_used, TRUE); +void info_audio_length_changed(const double video_length, const double audio_length, const BOOL exedit_is_used, const double av_length_threshold) { + message_audio_length_different(video_length, audio_length, exedit_is_used, av_length_threshold, TRUE); } -void warning_audio_length(const double video_length, const double audio_length, const BOOL exedit_is_used) { - message_audio_length_different(video_length, audio_length, exedit_is_used, FALSE); +void error_audio_length(const double video_length, const double audio_length, const BOOL exedit_is_used, const double av_length_threshold) { + message_audio_length_different(video_length, audio_length, exedit_is_used, av_length_threshold, FALSE); } void error_audenc_failed(const wchar_t *name, const char *args) { diff --git a/NVEnc/frm/auo_error.h b/NVEnc/frm/auo_error.h index 219cb385..3e243861 100644 --- a/NVEnc/frm/auo_error.h +++ b/NVEnc/frm/auo_error.h @@ -78,8 +78,9 @@ void error_video_get_conv_func(); void warning_auto_qpfile_failed(); void warning_auo_tcfile_failed(); void error_open_wavfile(); -void info_audio_length_changed(const double video_length, const double audio_length, const BOOL exedit_is_used); -void warning_audio_length(const double video_length, const double audio_length, const BOOL exedit_is_used); +void error_audio_length_zero(const BOOL exedit_is_used); +void info_audio_length_changed(const double video_length, const double audio_length, const BOOL exedit_is_used, const double av_length_threshold); +void error_audio_length(const double video_length, const double audio_length, const BOOL exedit_is_used, const double av_length_threshold); void error_malloc_pixel_data(); void error_malloc_tc(); diff --git a/NVEnc/frm/auo_mes.cpp b/NVEnc/frm/auo_mes.cpp index b1276431..4259b57e 100644 --- a/NVEnc/frm/auo_mes.cpp +++ b/NVEnc/frm/auo_mes.cpp @@ -193,7 +193,21 @@ static const char * AUO_MES_ID_NAME_STR[] = { "AUO_ERR_AFS_GET_FRAME", "AUO_ERR_OPEN_WAVFILE", "AUO_ERR_NO_WAVFILE", +"AUO_ERR_AUDIO_LENGTH_EXEDIT1", +"AUO_ERR_AUDIO_LENGTH_EXEDIT2", +"AUO_ERR_AUDIO_LENGTH_EXEDIT3", +"AUO_ERR_AUDIO_LENGTH_EXEDIT4", +"AUO_ERR_AUDIO_LENGTH_EXEDIT5", +"AUO_ERR_AUDIO_LENGTH_EXEDIT6", +"AUO_ERR_AUDIO_LENGTH_EXEDIT7", +"AUO_ERR_AUDIO_LENGTH_ZERO1", +"AUO_ERR_AUDIO_LENGTH_ZERO2", +"AUO_ERR_AUDIO_LENGTH_ZERO3", +"AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO1", +"AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO2", +"AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO3", "AUO_ERR_AUDIO_LENGTH_DIFFERENT1", +"AUO_ERR_AUDIO_LENGTH_DIFFERENT1_2", "AUO_ERR_AUDIO_LENGTH_DIFFERENT2", "AUO_ERR_AUDIO_LENGTH_DIFFERENT3", "AUO_ERR_AUDIO_LENGTH_DIFFERENT4", diff --git a/NVEnc/frm/auo_mes.h b/NVEnc/frm/auo_mes.h index ca1971b9..04ae430d 100644 --- a/NVEnc/frm/auo_mes.h +++ b/NVEnc/frm/auo_mes.h @@ -231,7 +231,22 @@ enum AuoMes { AUO_ERR_OPEN_WAVFILE, AUO_ERR_NO_WAVFILE, + AUO_ERR_AUDIO_LENGTH_EXEDIT1, + AUO_ERR_AUDIO_LENGTH_EXEDIT2, + AUO_ERR_AUDIO_LENGTH_EXEDIT3, + AUO_ERR_AUDIO_LENGTH_EXEDIT4, + AUO_ERR_AUDIO_LENGTH_EXEDIT5, + AUO_ERR_AUDIO_LENGTH_EXEDIT6, + AUO_ERR_AUDIO_LENGTH_EXEDIT7, + AUO_ERR_AUDIO_LENGTH_ZERO1, + AUO_ERR_AUDIO_LENGTH_ZERO2, + AUO_ERR_AUDIO_LENGTH_ZERO3, + AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO1, + AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO2, + AUO_ERR_AUDIO_LENGTH_PROMPT_YESNO3, + AUO_ERR_AUDIO_LENGTH_DIFFERENT1, + AUO_ERR_AUDIO_LENGTH_DIFFERENT1_2, AUO_ERR_AUDIO_LENGTH_DIFFERENT2, AUO_ERR_AUDIO_LENGTH_DIFFERENT3, AUO_ERR_AUDIO_LENGTH_DIFFERENT4, diff --git a/NVEnc/prm/auo_settings.cpp b/NVEnc/prm/auo_settings.cpp index df93281b..d8e63b11 100644 --- a/NVEnc/prm/auo_settings.cpp +++ b/NVEnc/prm/auo_settings.cpp @@ -652,6 +652,7 @@ void guiEx_settings::load_local() { s_local.default_audio_encoder_ext = GetPrivateProfileInt( ini_section_main, "default_audio_encoder", DEFAULT_AUDIO_ENCODER_EXT, conf_fileName); s_local.default_audio_encoder_in = GetPrivateProfileInt( ini_section_main, "default_audio_encoder_in", DEFAULT_AUDIO_ENCODER_IN, conf_fileName); s_local.default_audenc_use_in = GetPrivateProfileInt( ini_section_main, "default_audenc_use_in", DEFAULT_AUDIO_ENCODER_USE_IN, conf_fileName); + s_local.av_length_threshold = GetPrivateProfileDouble(ini_section_main, "av_length_threshold", DEFAULT_AV_LENGTH_DIFF_THRESOLD, conf_fileName); #if ENCODER_QSV s_local.force_bluray = GetPrivateProfileInt( ini_section_main, "force_bluray", DEFAULT_FORCE_BLURAY, conf_fileName); s_local.perf_monitor = GetPrivateProfileInt( ini_section_main, "perf_monitor", DEFAULT_PERF_MONITOR, conf_fileName); @@ -736,6 +737,7 @@ void guiEx_settings::save_local() { WritePrivateProfileIntWithDefault( ini_section_main, "default_audio_encoder", s_local.default_audio_encoder_ext, DEFAULT_AUDIO_ENCODER_EXT, conf_fileName); WritePrivateProfileIntWithDefault( ini_section_main, "default_audio_encoder_in", s_local.default_audio_encoder_in, DEFAULT_AUDIO_ENCODER_IN, conf_fileName); WritePrivateProfileIntWithDefault( ini_section_main, "default_audenc_use_in", s_local.default_audenc_use_in, DEFAULT_AUDIO_ENCODER_USE_IN, conf_fileName); + WritePrivateProfileDoubleWithDefault(ini_section_main, "av_length_threshold", s_local.av_length_threshold, DEFAULT_AV_LENGTH_DIFF_THRESOLD,conf_fileName); #if ENCODER_QSV WritePrivateProfileIntWithDefault( ini_section_main, "force_bluray", s_local.force_bluray, DEFAULT_FORCE_BLURAY, conf_fileName); WritePrivateProfileIntWithDefault( ini_section_main, "perf_monitor", s_local.perf_monitor, DEFAULT_PERF_MONITOR, conf_fileName); diff --git a/NVEnc/prm/auo_settings.h b/NVEnc/prm/auo_settings.h index 3a34fb59..d2793286 100644 --- a/NVEnc/prm/auo_settings.h +++ b/NVEnc/prm/auo_settings.h @@ -56,6 +56,7 @@ static const BOOL DEFAULT_FORCE_BLURAY = 0; static const BOOL DEFAULT_PERF_MONITOR = 0; static const BOOL DEFAULT_PERF_MONITOR_PLOT = 0; #endif +static const double DEFAULT_AV_LENGTH_DIFF_THRESOLD = 0.05; static const int DEFAULT_LOG_LEVEL = 0; static const BOOL DEFAULT_LOG_WINE_COMPAT = 0; @@ -357,6 +358,7 @@ typedef struct LOCAL_SETTINGS { BOOL default_audenc_use_in; //デフォルトã®éŸ³å£°ã‚¨ãƒ³ã‚³ãƒ¼ãƒ€ã¨ã—ã¦ã€å†…蔵エンコーダをé¸æŠžã™ã‚‹ int default_audio_encoder_ext; //デフォルトã®éŸ³å£°ã‚¨ãƒ³ã‚³ãƒ¼ãƒ€ int default_audio_encoder_in; //デフォルトã®éŸ³å£°ã‚¨ãƒ³ã‚³ãƒ¼ãƒ€ + double av_length_threshold; //音声ã¨æ˜ åƒã®é•·ã•ã®å·®ã®å‰²åˆãŒã“ã®å€¤ã‚’超ãˆã‚‹å ´åˆã€ã‚¨ãƒ©ãƒ¼ãƒ»è­¦å‘Šã‚’表示ã™ã‚‹ BOOL get_relative_path; //相対パスã§ä¿å­˜ã™ã‚‹ BOOL run_bat_minimized; //エンコå‰å¾Œãƒãƒƒãƒå‡¦ç†ã‚’最å°åŒ–ã§å®Ÿè¡Œ #if ENCODER_QSV