Skip to content

Commit 0db9f73

Browse files
authored
feat(nvenc): support intraRefresh for h264, add outputRecoveryPointSEI=1 to intra-refresh config for h264 and hevc (#5091)
1 parent 810783d commit 0db9f73

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/nvenc/nvenc_base.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,21 @@ namespace nvenc {
340340
set_ref_frames(format_config.maxNumRefFrames, format_config.numRefL0, 5);
341341
set_minqp_if_enabled(config.min_qp_h264);
342342
fill_h264_hevc_vui(format_config.h264VUIParameters);
343+
if (client_config.enableIntraRefresh == 1) {
344+
if (get_encoder_cap(NV_ENC_CAPS_SUPPORT_INTRA_REFRESH)) {
345+
format_config.enableIntraRefresh = 1;
346+
format_config.intraRefreshPeriod = 300;
347+
format_config.intraRefreshCnt = 299;
348+
format_config.outputRecoveryPointSEI = 1;
349+
if (get_encoder_cap(NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH)) {
350+
format_config.singleSliceIntraRefresh = 1;
351+
} else {
352+
BOOST_LOG(warning) << "NvEnc: Single Slice Intra Refresh not supported";
353+
}
354+
} else {
355+
BOOST_LOG(error) << "NvEnc: Client asked for intra-refresh but the encoder does not support intra-refresh";
356+
}
357+
}
343358
break;
344359
}
345360

@@ -360,6 +375,7 @@ namespace nvenc {
360375
format_config.enableIntraRefresh = 1;
361376
format_config.intraRefreshPeriod = 300;
362377
format_config.intraRefreshCnt = 299;
378+
format_config.outputRecoveryPointSEI = 1;
363379
if (get_encoder_cap(NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH)) {
364380
format_config.singleSliceIntraRefresh = 1;
365381
} else {

0 commit comments

Comments
 (0)