From 84f9a042729ca76b3b56e824fede202cc6d2897b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 23 Dec 2023 12:40:16 +0100 Subject: Small changes who cares --- README.md | 7 +++---- TODO | 2 ++ src/capture/nvfbc.c | 3 ++- src/main.cpp | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 736cb74..4c93c00 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a screen recorder that has minimal impact on system performance by recor similar to shadowplay on windows. This is the fastest screen recording tool for Linux. This screen recorder can be used for recording your desktop offline, for live streaming and for nvidia shadowplay-like instant replay, -where only the last moments are saved. +where only the last few minutes are saved. Supported video codecs: * H264 (default on Intel) @@ -31,8 +31,7 @@ For you as a user this only means that if you installed GPU Screen Recorder as a On a system with a i5 4690k CPU and a GTX 1080 GPU:\ 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 GTA V at 4k on highest settings, fps drops from 60 to 23 when using obs-nvfbc + nvenc, however when using this screen recorder the fps only drops to 58. The quality is also much better when using gpu screen recorder.\ -It is recommended to save the video to a SSD because of the large file size, which a slow HDD might not be fast enough to handle.\ -Note that if you have a very powerful CPU and a not so powerful GPU and play a game that is bottlenecked by your GPU and barely uses your CPU then a CPU based screen recording (such as OBS with libx264 instead of nvenc) might perform slightly better than GPU Screen Recorder. At least on NVIDIA. +It is recommended to save the video to a SSD because of the large file size, which a slow HDD might not be fast enough to handle. ## Note about optimal performance on NVIDIA NVIDIA driver has a "feature" (read: bug) where it will downclock memory transfer rate when a program uses cuda (or nvenc, which uses cuda), such as GPU Screen Recorder. To work around this bug, GPU Screen Recorder can overclock your GPU memory transfer rate to it's normal optimal level.\ To enable overclocking for optimal performance use the `-oc` option when running GPU Screen Recorder. You also need to have "Coolbits" NVIDIA X setting set to "12" to enable overclocking. You can automatically add this option if you run `sudo nvidia-xconfig --cool-bits=12` and then reboot your computer.\ @@ -139,7 +138,7 @@ Some linux distros (such as manjaro) disable hardware accelerated h264/hevc on A ## I have an old nvidia GPU that supports nvenc but I get a cuda error when trying to record Newer ffmpeg versions don't support older nvidia cards. Try installing GPU Screen Recorder flatpak from [flathub](https://flathub.org/apps/details/com.dec05eba.gpu_screen_recorder) instead. It comes with an older ffmpeg version which might work for your GPU. ## I get a black screen/glitches while live streaming -It seems like ffmpeg earlier than version 6.1 has some type of bug. Install ffmpeg 6.1 and then reinstall GPU Screen Recorder to fix this issue. +It seems like ffmpeg earlier than version 6.1 has some type of bug. Install ffmpeg 6.1 and then reinstall GPU Screen Recorder to fix this issue. The flatpak version of GPU Screen Recorder comes with ffmpeg 6.1 so no extra steps are needed. # Donations If you want to donate you can donate via bitcoin or monero. diff --git a/TODO b/TODO index e96ef3f..c7d3a75 100644 --- a/TODO +++ b/TODO @@ -108,3 +108,5 @@ Test if p2 state can be worked around by using pure nvenc api and overwriting cu nvenc uses cuda when using b frames and rgb->yuv conversion, so convert the image ourselves instead.- Mesa doesn't support global headers (AV_CODEC_FLAG_GLOBAL_HEADER) with h264... which also breaks mkv since mkv requires global header. Right now gpu screen recorder will forcefully set video codec to hevc when h264 is requested for mkv files. + +Drop frames if live streaming cant keep up with target fps, or dynamically change resolution/quality. diff --git a/src/capture/nvfbc.c b/src/capture/nvfbc.c index 5b62310..e6ee1a9 100644 --- a/src/capture/nvfbc.c +++ b/src/capture/nvfbc.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -297,7 +298,7 @@ static int gsr_capture_nvfbc_start(gsr_capture *cap, AVCodecContext *video_codec if(capture_region) create_capture_params.captureBox = (NVFBC_BOX){ x, y, width, height }; create_capture_params.eTrackingType = tracking_type; - create_capture_params.dwSamplingRateMs = 1000u / ((uint32_t)cap_nvfbc->params.fps + 1); + create_capture_params.dwSamplingRateMs = (uint32_t)ceilf(1000.0f / (float)cap_nvfbc->params.fps); create_capture_params.bAllowDirectCapture = direct_capture ? NVFBC_TRUE : NVFBC_FALSE; create_capture_params.bPushModel = direct_capture ? NVFBC_TRUE : NVFBC_FALSE; //create_capture_params.bDisableAutoModesetRecovery = true; // TODO: diff --git a/src/main.cpp b/src/main.cpp index 8761805..d257bc2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -811,8 +811,8 @@ static void usage_full() { fprintf(stderr, " -ac Audio codec to use. Should be either 'aac', 'opus' or 'flac'. Defaults to 'opus' for .mp4/.mkv files, otherwise defaults to 'aac'.\n"); fprintf(stderr, " 'opus' and 'flac' is only supported by .mp4/.mkv files. 'opus' is recommended for best performance and smallest audio size.\n"); fprintf(stderr, "\n"); - fprintf(stderr, " -oc Overclock memory transfer rate to the maximum performance level. This only applies to NVIDIA on X11 and exists to overcome a bug in NVIDIA driver where performance level. The same issue exists on Wayland but overclocking is not possible on Wayland.\n"); - fprintf(stderr, " is dropped when you record a game. Only needed if you are recording a game that is bottlenecked by GPU.\n"); + fprintf(stderr, " -oc Overclock memory transfer rate to the maximum performance level. This only applies to NVIDIA on X11 and exists to overcome a bug in NVIDIA driver where performance level\n"); + fprintf(stderr, " is dropped when you record a game. Only needed if you are recording a game that is bottlenecked by GPU. The same issue exists on Wayland but overclocking is not possible on Wayland.\n"); fprintf(stderr, " Works only if your have \"Coolbits\" set to \"12\" in NVIDIA X settings, see README for more information. Note! use at your own risk! Optional, disabled by default.\n"); fprintf(stderr, "\n"); fprintf(stderr, " -fm Framerate mode. Should be either 'cfr' or 'vfr'. Defaults to 'cfr' on NVIDIA X11 and 'vfr' on AMD/Intel X11/Wayland or NVIDIA Wayland.\n"); -- cgit v1.2.3