GPU-SCREEN-RECORDER(1)

NAME
gpu-screen-recorder - The fastest screen recording tool for Linux

SYNOPSIS
gpu-screen-recorder -w window_id|monitor|focused|portal|region|v4l2_device_path [options] -o output_file

gpu-screen-recorder --help | --version | --info | --list-capture-options | --list-monitors | --list-v4l2-devices | --list-audio-devices | --list-application-audio

DESCRIPTION
gpu-screen-recorder is the fastest screen recording tool for Linux. It uses the GPU only to record the screen to minimize system performance impact. It supports recording, live streaming, instant replay (similar to NVIDIA ShadowPlay), and screenshot capture. The tool works on both X11 and Wayland with AMD, Intel, and NVIDIA graphics cards.

Key features include:

    •   GPU-accelerated encoding using H264, HEVC, AV1, VP8, or VP9 codecs

    •   Support for HDR recording (HEVC HDR and AV1 HDR)

    •   Instant replay buffer (last N seconds recording)

    •   Live streaming capabilities

    •   Audio recording from devices and applications (PipeWire required for app audio)

    •   Plugin system for custom graphics overlay

    •   Minimal performance impact compared to traditional screen recorders

OPTIONS

  Capture Options

-w window_id|monitor|focused|portal|region|v4l2_device_path
    Specify what to record. Formats:

    •   window - Record a specific window (use window ID) (X11 only)

    •   screen - Record the first monitor found

    •   screen-direct - NVIDIA X11 only, for VRR/G-SYNC support (not recommended due to driver issues)

    •   focused - Record the currently focused window (X11 only) (use with -s option)

    •   portal - Use xdg-desktop-portal with PipeWire (Wayland only)

    •   region - Record a specific region (use with -region option)

    •   Monitor name (e.g., DP-1) - Record specific monitor

    •   V4L2 device path (e.g., /dev/video0) - Record camera device (V4L2).

        Other applications can't use the camera when GPU Screen Recorder is using the camera and GPU Screen Recorder may not be able to use the camera if another application is already using the camera

    •   Combine sources with | (e.g., monitor:screen|v4l2:/dev/video0)

Run --list-capture-options to list available capture sources.

Additional options can be passed to each capture source by splitting capture source with ; for example screen;x=50;y=50.
These are the available options for all capture sources (optional):

    •   x - The X position in pixels. If the number ends with % then this sets the X position relative to the video width (integer percentage where 100 = 100%)

    •   y - The Y position in pixels. If the number ends with % then this sets the Y position relative to the video height (integer percentage where 100 = 100%)

    •   width - The width in pixels. If the number ends with % then this sets the width relative to the video width (integer percentage where 100 = 100%).

        A value of 0 means to not scale the capture source and instead use the original width.

    •   height - The height in pixels. If the number ends with % then this sets the height relative to the video height (integer percentage where 100 = 100%).

        A value of 0 means to not scale the capture source and instead use the original height.

    •   halign - The horizontal alignment, should be either start, center or end.

        Set to center by default when using one capture source, otherwise it's set to start by default.

    •   valign - The vertical alignment, should be either start, center or end.

        Set to center by default when using one capture source, otherwise it's set to start by default.

    •   hflip - If the source should be flipped horizontally, should be either true or false. Set to false by default

    •   vflip - If the source should be flipped vertically, should be either true or false. Set to false by default

These are the additional options available for camera (V4L2) sources (optional):

    •   pixfmt - The pixel format, should be either auto, yuyv or mjpeg. Set to auto by default

    •   camera_fps - The camera fps. Has to match a camera fps returned in --info or --list-v4l2-devices for the device.

        A value of 0 means to use the best option available.

    •   camera_width - The camera width in pixels. Has to match a camera width returned in --info or --list-v4l2-devices for the device.

        A value of 0 means to use the best option available.

    •   camera_height - The camera height in pixels. Has to match a camera height returned in --info or --list-v4l2-devices for the device.

        A value of 0 means to use the best option available.

-region WxH+X+Y
    Specify region to capture when using -w region. Format is width x height + X offset + Y offset. Set width and height to 0 to capture the whole monitor that contains the position.

    It is compatible with tools such as slop (X11) and slurp (Wayland).

-c container_format
    Container format (mp4, mkv, flv, webm). Defaults to extension from -o filename.

-s WxH
    Output resolution limit (e.g., 1920x1080). Use 0x0 for original resolution. Required for -w focused.

-f fps
    Frame rate (default: 60). For variable frame rate mode, this is maximum FPS.

-cursor yes|no
    Record cursor (default: yes).

-restore-portal-session yes|no
    Restore previous portal session (used with -w portal option, default: no).

  Audio Options

-a audio_source
    Audio device or application to record. Can be specified multiple times. Formats:

    •   default_output - Default output device

    •   default_input - Default input device

    •   device:name - Specific device

    •   app:name - Application audio (case-insensitive)

    •   app-inverse:name - All applications except specified

    •   Combine sources with | (e.g., default_output|app:firefox)

Run --list-audio-devices to list available audio devices.
Run --list-application-audio to list available applications for audio capture.

-ac aac|opus|flac
    Audio codec (default: opus for mp4/mkv, aac otherwise). FLAC temporarily disabled.

-ab bitrate
    Audio bitrate in kbps (default: 128 for opus/flac, 160 for aac). 0 = automatic.

  Video Quality Options

-k codec
    Video codec: auto, h264, hevc, av1, vp8, vp9, hevc_hdr, av1_hdr, hevc_10bit, av1_10bit, h264_vulkan, hevc_vulkan, hevc_10bit_vulkan, av1_vulkan, av1_hdr_vulkan, av1_10bit_vulkan

    HDR options not available on X11 or portal capture. 10-bit capture reduces banding but may not be supported properly by all video players.
    Vulkan codec options are experimental. They may not work properly on your system because of GPU driver issues.
    Using vulkan codecs may result in better gaming performance with older NVIDIA gpu drivers, as vulkan video encoding doesn't suffer from an issue known as "cuda p2 state"
    where the GPU gets downclocked when using nvenc (regular video codecs on NVIDIA).

    (default: auto → h264).

-q quality
    Quality preset (medium, high, very_high, ultra) for QP/VBR mode, or bitrate (kbps) for CBR mode (default: very_high).

-bm auto|qp|vbr|cbr
    Bitrate mode (default: auto → qp). CBR recommended for replay buffer and live streaming.

    QP means to capture with constant quality, even in motion, while VBR and CBR means to capture with constant size.

-fm cfr|vfr|content
    Frame rate mode: cfr (constant), vfr (variable), or content (match content) (default: vfr). Content mode is only available on X11 or portal.

    Content mode syncs video to the captured content and is recommended for smoothest video when the game is running at the same frame rate or lower than what you are trying to record at.

-cr limited|full
    Color range (default: limited). Full range may cause issues with some video players/websites.

-tune performance|quality
    Encoding tune (default: performance). Currently NVIDIA only.

-keyint seconds
    Keyframe interval in seconds (default: 2.0). Affects seeking precision.

-encoder gpu|cpu
    Encoding device (default: gpu). CPU encoding only for H264.

-fallback-cpu-encoding yes|no
    Fallback to CPU if GPU encoding unavailable (default: no).

  Replay Buffer Options

-r seconds
    Replay buffer duration (2-86400 seconds). When set, only saves on command.

-replay-storage ram|disk
    Buffer storage location (default: ram). Disk mode may reduce SSD lifespan.

-restart-replay-on-save yes|no
    Clear buffer after saving replay (default: no).

-df yes|no
    Organize replays in date-based folders (default: no).

  Advanced Options

-p plugin.so
    Load plugin (.so file). Can be specified multiple times.

-sc script_path
    Script to run after saving video. Receives filepath and type ("regular", "replay", "screenshot").

-portal-session-token-filepath path
    Portal session token file (default: ~/.config/gpu-screen-recorder/restore_token).

-ffmpeg-opts options
    Additional arguments to pass to FFmpeg for the file in a list of key-values pairs in the format "key=value;key=value",
    for example: -ffmpeg-opts "hls_list_size=3;hls_time=1;hls_flags=delete_segments".
    Note: this overwrites options set by GPU Screen Recorder with the same name.

-ffmpeg-video-opts options
    Additional arguments to pass to FFmpeg for the video in a list of key-values pairs in the format "key=value;key=value",
    for example: -ffmpeg-video-opts "codec=cabac;rc_mode=CQP;qp=16".
    Note: this overwrites options set by GPU Screen Recorder with the same name.

-ffmpeg-audio-opts options
    Additional arguments to pass to FFmpeg for the audio in a list of key-values pairs in the format "key=value;key=value",
    for example: -ffmpeg-audio-opts "aac_coder=fast;aac_pce=true".
    Note: this overwrites options set by GPU Screen Recorder with the same name.

-gl-debug yes|no
    OpenGL debug output (default: no).

-v yes|no
    Print FPS and damage info (default: yes).

-low-power yes|no
    Run in low power mode. This currently has only an affect on AMD (as it's only an issue on AMD) and allows the GPU to go into a lower power mode when recording (default: no).
    Setting this to yes might not always be ideal because of AMD driver issues where after playing a video with VAAPI on the system the video encoding performance also reduces, which affects GPU Screen Recorder.
    It's recommended to also use the option -fm content when this is set to yes to only encode frames when the screen content updates to lower GPU and video encoding usage when the system is idle.

-write-first-frame-ts yes|no
    When enabled, writes a timestamp file with extra extension .ts next to the output video containing:
    monotonic_microsec	realtime_microsec
    <monotonic_microsec>	<realtime_microsec>
    (default: no). Ignored for live streaming and when output is piped.

  Output Options

-o output
    Output file path (or directory for replay mode). Required except when outputting to stdout.

-ro directory
    Output directory for regular recordings during replay/streaming mode.

  Information Commands

--help
    Show help message.

--version
    Show version (5.10.2).

--info
    Show system info (codecs, capture options).

--list-capture-options
    List available capture sources (window, monitors, portal, v4l2 device path).

--list-monitors
    List available monitors.

--list-v4l2-devices
    List available cameras devices (V4L2).

--list-audio-devices
    List available audio devices.

--list-application-audio
    List available applications for audio capture.

SIGNALS
GPU Screen Recorder can be controlled via signals:

SIGINT (Ctrl+C)
    Stop and save recording (stop without save in replay mode).

SIGUSR1
    Save replay (replay mode only).

SIGUSR2
    Pause/unpause recording (not for streaming/replay).

SIGRTMIN
    Start/stop regular recording during replay/streaming.

SIGRTMIN+1
    Save last 10 seconds (replay mode).

SIGRTMIN+2
    Save last 30 seconds (replay mode).

SIGRTMIN+3
    Save last 60 seconds (replay mode).

SIGRTMIN+4
    Save last 5 minutes (replay mode).

SIGRTMIN+5
    Save last 10 minutes (replay mode).

SIGRTMIN+6
    Save last 30 minutes (replay mode).

Use pkill to send signals (e.g., pkill -SIGUSR1 -f "^gpu-screen-recorder").

EXAMPLES
Record monitor at 60 FPS with desktop audio:

    gpu-screen-recorder -w screen -f 60 -a default_output -o video.mp4

Record monitor at 60 FPS with desktop audio and microphone:

    gpu-screen-recorder -w screen -f 60 -a "default_output|default_input" -o video.mp4

Record specific window (X11 only):

    gpu-screen-recorder -w $(xdotool selectwindow) -f 60 -o video.mp4

Instant replay (last 60 seconds):

    gpu-screen-recorder -w screen -c mkv -r 60 -o ~/Videos

Record region using slop:

    gpu-screen-recorder -w $(slop) -o video.mp4

Record region using slurp:

    gpu-screen-recorder -w $(slurp -f "%wx%h+%x+%y") -o video.mp4

Instant replay and launch a script when saving replay:

    gpu-screen-recorder -w screen -c mkv -r 60 -sc ./script.sh -o ~/Videos

Stream to Twitch with constant bitrate mode:

    gpu-screen-recorder -w screen -c flv -a default_output -bm cbr -q 8000 -o "rtmp://live.twitch.tv/app/stream_key"

Take screenshot:

    gpu-screen-recorder -w screen -o screenshot.jpg

Record screen and camera:

    gpu-screen-recorder -w "screen|/dev/video0" -o video.mp4

Record screen and camera. The camera is located at the bottom right and flipped horizontally:

    gpu-screen-recorder -w "screen|/dev/video0;halign=end;valign=end;hflip=true;width=30%;height=30%" -o video.mp4

Record two monitors, side by side (assuming the first monitor has a resolution of 1920x1080)

    gpu-screen-recorder -w "DP-1|DP-2;x=1920" -o video.mp4

FILES

~/.config/gpu-screen-recorder/gpu-screen-recorder.env
    Environment variables for systemd service (optional).

/usr/lib/modprobe.d/gsr-nvidia.conf
    NVIDIA suspend/resume fix.

~/.config/gpu-screen-recorder/restore_token
    Portal session token storage (default location).

TIPS

•   Some video editors don't support videos in variable frame rate mode.

    Change video container to .mkv or capture in constant frame rate mode instead to workaround this issue

•   Variable frame rate may cause issues in some video players (use MPV)

•   H.265/HEVC not supported in browsers/Discord (use H264 for sharing)

•   Some distros disable hardware codecs (use Flatpak version)

•   Use CBR mode ( -bm cbr ) for replay buffer to control RAM usage

PERFORMANCE TIPS

•   Save to SSD (HDD may be too slow)

•   Close other screen recorders (including idle OBS)

KNOWN ISSUES

•   NVIDIA: CUDA breaks after suspend (install gsr-nvidia.conf fix)

•   AMD: Possible black bars in output video with HEVC/AV1 (use H264 or FFmpeg >=8)

AUTHORS
Developed by dec05eba and contributors.

REPORTING BUGS
Report bugs to: dec05eba@protonmail.com (mailto:dec05eba@protonmail.com).
See more information about reporting bugs at the gpu-screen-recorder website: https://git.dec05eba.com/?p=about (https://git.dec05eba.com/?p=about).
Please take a look at the FAQ part of the README before reporting a bug: https://git.dec05eba.com/gpu-screen-recorder/about/ (https://git.dec05eba.com/gpu-screen-recorder/about/).
The bug may have been previously reported or may not be related to gpu-screen-recorder (such as a driver issue).

COPYRIGHT
Copyright © dec05eba. Licensed under GPL3-only.

SEE ALSO
Project homepage (https://git.dec05eba.com/gpu-screen-recorder)
Project readme, with more information (https://git.dec05eba.com/gpu-screen-recorder/about)
GTK GUI version (deprecated) (https://git.dec05eba.com/gpu-screen-recorder-gtk)
ShadowPlay-style UI (https://git.dec05eba.com/gpu-screen-recorder-ui)
xdotool(1), slop(1), slurp(1),