Add option for intra refresh (resolves #86)

This commit is contained in:
Yukino Song
2024-10-26 21:31:28 +08:00
parent 90ed57eeb3
commit 11e0bad4f3
8 changed files with 28 additions and 5 deletions

View File

@@ -1008,6 +1008,7 @@ namespace config {
bool_f(vars, "nvenc_spatial_aq", video.nv.adaptive_quantization);
generic_f(vars, "nvenc_twopass", video.nv.two_pass, nv::twopass_from_view);
bool_f(vars, "nvenc_h264_cavlc", video.nv.h264_cavlc);
bool_f(vars, "nvenc_intra_refresh", video.nv.intra_refresh);
bool_f(vars, "nvenc_realtime_hags", video.nv_realtime_hags);
bool_f(vars, "nvenc_opengl_vulkan_on_dxgi", video.nv_opengl_vulkan_on_dxgi);
bool_f(vars, "nvenc_latency_over_power", video.nv_sunshine_high_power_mode);

View File

@@ -321,10 +321,14 @@ namespace nvenc {
set_ref_frames(format_config.maxNumRefFramesInDPB, format_config.numRefL0, 5);
set_minqp_if_enabled(config.min_qp_hevc);
fill_h264_hevc_vui(format_config.hevcVUIParameters);
format_config.enableIntraRefresh = 1;
format_config.singleSliceIntraRefresh = 1;
format_config.intraRefreshPeriod = 300;
format_config.intraRefreshCnt = 299;
if (config.intra_refresh) {
format_config.enableIntraRefresh = 1;
format_config.singleSliceIntraRefresh = 1;
format_config.intraRefreshPeriod = 300;
format_config.intraRefreshCnt = 299;
}
break;
}

View File

@@ -48,6 +48,9 @@ namespace nvenc {
// Add filler data to encoded frames to stay at target bitrate, mainly for testing
bool insert_filler_data = false;
// Intra refresh for clients that doesn't request keyframe correctly
bool intra_refresh = false;
};
} // namespace nvenc