diff --git a/README.md b/README.md index 4f20586..267bbbd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ where only the last few seconds are saved. ## Note For NvFBC to work with PRIME, you must set the primary GPU to your dedicated Nvidia graphics card. On Pop OS, you can select the 'NVIDIA Graphics' option in the power menu, or on Arch Linux you can use Optimus Manager.\ If you are using a variable refresh rate monitor, then choose to record "screen-direct". This will allow variable refresh rate to work when recording fullscreen applications. Note that some applications such as mpv will not work in fullscreen mode. A fix is being developed for this. +### TEMPORARY ISSUE ### +screen-direct capture has been temporary disabled as it causes issues with stuttering. This might be a nvfbc bug. # Performance When recording Legend of Zelda Breath of the Wild at 4k, fps drops from 30 to 7 when using OBS Studio + nvenc, however when using this screen recorder the fps remains at 30.\ 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;