diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-10-04 02:23:40 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-10-04 02:23:40 +0200 |
commit | f55b71343774c1a4ac222879a6aa9da5cad4ec1e (patch) | |
tree | a37fe0cc7f44477996dcceaffa9cce4df2eca3ca /src | |
parent | e277abe843e6ad38b2a727b593fdc83f11164821 (diff) |
Temporary disable screen-direct recording as it causes stuttering (nvfbc bug?)
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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<int>::max(); - //codec_context->keyint_min = std::numeric_limits<int>::max(); + codec_context->gop_size = std::numeric_limits<int>::max(); + codec_context->keyint_min = std::numeric_limits<int>::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; |