From f55b71343774c1a4ac222879a6aa9da5cad4ec1e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 4 Oct 2022 02:23:40 +0200 Subject: Temporary disable screen-direct recording as it causes stuttering (nvfbc bug?) --- src/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 79fee50..5af3f01 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -632,9 +632,8 @@ static AVCodecContext *create_video_codec_context(AVFormatContext *av_format_con if(is_livestream) { codec_context->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY); codec_context->flags2 |= AV_CODEC_FLAG2_FAST; - codec_context->gop_size = fps * 2; - //codec_context->gop_size = std::numeric_limits::max(); - //codec_context->keyint_min = std::numeric_limits::max(); + codec_context->gop_size = std::numeric_limits::max(); + codec_context->keyint_min = std::numeric_limits::max(); } else { codec_context->gop_size = fps * 2; } @@ -1296,9 +1295,13 @@ int main(int argc, char **argv) { return 1; const char *capture_target = window_str; - const bool direct_capture = strcmp(window_str, "screen-direct") == 0; - if(direct_capture) + bool direct_capture = strcmp(window_str, "screen-direct") == 0; + if(direct_capture) { capture_target = "screen"; + // TODO: Temporary disable direct capture because push model causes stuttering when it's direct capturing. This might be a nvfbc bug. This does not happen when using a compositor. + direct_capture = false; + fprintf(stderr, "Warning: screen-direct has temporary been disabled as it causes stuttering. This is likely a NvFBC bug. Falling back to \"screen\".\n"); + } if(!nv_fbc_library.create(capture_target, fps, &window_width, &window_height, region_x, region_y, region_width, region_height, direct_capture)) return 1; -- cgit v1.2.3