Find you get too much of a performance hit using other recording tools like OBS Studio? Maybe this new tool will help. It doesn't have a fancy name, just called "gpu screen recorder" along with GTK front-end you can use to help manage it.
They claim it's the "fastest screen recording tool for Linux". Why make it? Well, in their own words on how it's different to OBS when paired with NVENC:
OBS only uses the gpu for video encoding, but the window image that is encoded is sent from the GPU to the CPU and then back to the GPU. These operations are very slow and causes all of the fps drops when using OBS. OBS only uses the GPU efficiently on Windows 10 and Nvidia. This gpu-screen-recorder keeps the window image on the GPU and sends it directly to the video encoding unit on the GPU by using CUDA. This means that CPU usage remains at around 0% when using this screen recorder.
In their own testing, they said they saw FPS drops from 30 to 7 with OBS Studio at 4K but with their tool they saw a solid 30FPS. This of course highly depends on your CPU but the point here, is that it uses the full power of your GPU, and seeing a performance loss with OBS on Linux is pretty common.
They have a lot of plans for it including support for AMD and Intel GPUs, the ability to dynamically change bitrate / resolution to match desired fps, see the cursor in the recording and more.
Sounds like a great project, that could be helpful for those of you who want high-performance recordings or something more like Nvidia ShadowPlay perhaps.
https://www.gamingonlinux.com/2021/03/new-obs-plugin-offers-game-capture-solution-on-wayland-for-vulkan-renderers/
Yeah, it is not supported by nvidia.
-EDIT-
Quick search revealed others related:
ffmpeg frontend: https://github.com/Saren-Arterius/ussr
zerocopy obs plugin for x11: https://github.com/w23/obs-kmsgrab
zerocopy obs plugin Wayland: https://hg.sr.ht/~scoopta/wlrobs
-EDIT2-
Just made the following, on my system it takes 4% cpu use.
With default values it grabs:
from the first video card found
a portion of 1920x1080
at 30FPS
starting at position 0:0 (upper left)
scales the result to 1280x720
encodes it via vaapi in h264 at excellent quality (and big size ofc).
GRAB_SIZE=1920:1080 # How much of the screen you want to grab
GRAB_XY=0:0 # X:Y (upper-left of the grab area; 0:0 is the most upper left)
FRAMERATE=30 # Capture with this framerate
OUTPUT_SCALE=1280:720 # Rescale to this size
CODEC=h264_vaapi # Video codec, also try hevc_vaapi
QUALITY=18 # Video quality. The higher, the worse.
OUT_FILE=~/video_out.mkv # Write to this output file
ffmpeg -y -device /dev/dri/card0 -f kmsgrab -framerate $FRAMERATE -i - -vaapi_device /dev/dri/renderD128 -vf hwmap=derive_device=vaapi,crop=$GRAB_SIZE:$GRAB_XY,scale_vaapi=$OUTPUT_SCALE:format=nv12 -c:v $CODEC -qp:v $QUALITY $OUT_FILE
Last edited by kokoko3k on 11 April 2022 at 12:47 pm UTC
Advantage now is, I don't have to worry about creating a new source for a window capture as I can set the obs-nvfbc source to capture just one of my desktops. And the better performance when capturing.
Disadvantage though, I have to patch the nvidia driver with every release, and it's not officially supported.
Last edited by Corben on 11 April 2022 at 12:08 pm UTC
Quoting: CorbenAtm I'm using nvidia-patch and obs-nvfbc. Normally I don't have many issues with neither window capture nor full screen capture, but recently, when Cyberpunk didn't get captured and I switched to full screen capture, I saw a massive performance hit. Does not happen at all with nvfbc.
Advantage now is, I don't have to worry about creating a new source for a window capture as I can set the obs-nvfbc source to capture just one of my desktops. And the better performance when capturing.
Disadvantage though, I have to patch the nvidia driver with every release, and it's not officially supported.
If you capture much and have an IGP available, you may consider switching to a PRIME setup so that you will only tax the igp for grabbing and encoding.
Hopefully AMD support works out so I can use it myself :)
Needs to be something you can have running in the background, and use a key combo or something to record the last few minutes of what's in ram or something like that. I prefer something that can dump the last few minutes of gameplay to a video file, not something you have to use to start recording beforehand.
Quoting: CorbenAtm I'm using nvidia-patch and obs-nvfbcYou can also use nvlax with it's source patch.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fa8620..ee2f230 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,11 +16,11 @@ project(nvlax CXX)
include(ExternalProject)
include(cmake/FetchCPM.cmake)
-CPMAddPackage("gh:zyantific/zydis#master")
+CPMAddPackage("gh:zyantific/zydis#55dd08c210722aed81b38132f5fd4a04ec1943b5")
CPMAddPackage(
NAME LIEF_SRC
- GIT_TAG master
+ GIT_TAG b65e7cca03ec4cd91f1d7125e717d01635ea81ba
GITHUB_REPOSITORY lief-project/LIEF
DOWNLOAD_ONLY YES
)
@@ -59,7 +59,7 @@ message(STATUS "LIEF library: ${LIEF_LIBRARIES}")
CPMAddPackage(
NAME PPK_ASSERT
- GIT_TAG master
+ GIT_TAG 833b8b7ea49aea540a49f07ad08bf0bae1faac32
GITHUB_REPOSITORY gpakosz/PPK_ASSERT
DOWNLOAD_ONLY YES
)
To patch patch both libnvidia-encode and -fbc, unless nvidia massively changes their drivers, so far it has worked on each driver release.
same as the other one though.
sudo find / -iname "libnvidia*"
sudo ./nvlax-encode or ./nvlax-fbc -i /path/to/file/name -o /path/to/file/name
Quote2.1.3 Limitations.
No Modification or Reverse Engineering. Customer may not modify (except as provided in Section 2.1.2), reverse engineer, decompile, or disassemble the SOFTWARE, nor attempt in any other manner to obtain the source code.
In other words, the use of nvidia-patch/nvlax, even suggested by the developer of gpu-screen-recorder for fullscreen captures, is not permitted.
Last edited by kokoko3k on 12 April 2022 at 5:38 pm UTC
See more from me