Temporary disable screen-direct recording as it causes stuttering (nvfbc bug?)

This commit is contained in:
dec05eba 2022-10-04 02:23:40 +02:00
parent e277abe843
commit f55b713437
2 changed files with 10 additions and 5 deletions

View File

@ -8,6 +8,8 @@ where only the last few seconds are saved.
## Note ## 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.\ 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. 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 # 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.\ 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.\

View File

@ -632,9 +632,8 @@ static AVCodecContext *create_video_codec_context(AVFormatContext *av_format_con
if(is_livestream) { if(is_livestream) {
codec_context->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY); codec_context->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY);
codec_context->flags2 |= AV_CODEC_FLAG2_FAST; codec_context->flags2 |= AV_CODEC_FLAG2_FAST;
codec_context->gop_size = fps * 2; codec_context->gop_size = std::numeric_limits<int>::max();
//codec_context->gop_size = std::numeric_limits<int>::max(); codec_context->keyint_min = std::numeric_limits<int>::max();
//codec_context->keyint_min = std::numeric_limits<int>::max();
} else { } else {
codec_context->gop_size = fps * 2; codec_context->gop_size = fps * 2;
} }
@ -1296,9 +1295,13 @@ int main(int argc, char **argv) {
return 1; return 1;
const char *capture_target = window_str; const char *capture_target = window_str;
const bool direct_capture = strcmp(window_str, "screen-direct") == 0; bool direct_capture = strcmp(window_str, "screen-direct") == 0;
if(direct_capture) if(direct_capture) {
capture_target = "screen"; 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)) if(!nv_fbc_library.create(capture_target, fps, &window_width, &window_height, region_x, region_y, region_width, region_height, direct_capture))
return 1; return 1;