Friday, April 18, 2025

How to Compile the Latest wf-recorder from Source on Raspberry Pi 5 (Debian 12 Wayland)

On Debian 12 Bookworm (Raspberry Pi OS), the desktop environment runs natively on Wayland. Consequently, traditional X11 screen capture utilities (like FFmpeg's -f x11grab) no longer work.

The standard tool for recording Wayland sessions is wf-recorder. However, the stock wf-recorder v0.3 package provided in Debian's default repository lacks several modern enhancements, most notably the --overwrite flag. Compiling the latest version from source gives you full feature support, hardware-accelerated encoding, and audio capture.

1. Install Build Dependencies

Install the required C++ compilers, Meson build system, PipeWire, and FFmpeg development headers:

sudo apt-get update
sudo apt-get install -y g++ meson ninja-build libavutil-dev libavcodec-dev     libavformat-dev libswscale-dev libpulse-dev wayland-protocols libpipewire-0.3-dev wget

2. Download, Configure, and Build wf-recorder

mkdir -p ~/src && cd ~/src
wget https://github.com/ammen99/wf-recorder/releases/download/v0.5.0/wf-recorder-0.5.0.tar.xz
tar -xf wf-recorder-0.5.0.tar.xz
cd wf-recorder-0.5.0

# Configure release build with Meson
meson setup build --prefix=/usr --buildtype=release --reconfigure

# Compile with Ninja
ninja -C build

# Install binary to /usr/local/bin
sudo cp build/wf-recorder /usr/local/bin/

3. Recording Desktop Video and Audio

To record your full Wayland desktop screen with system audio output:

wf-recorder --overwrite -a default -f capture.mp4
Flag Breakdown:
  • --overwrite: Automatically overwrites existing destination files without prompting.
  • -a default: Captures audio from the default PulseAudio / PipeWire monitor source.
  • -f capture.mp4: Output file path. Stop recording at any time by pressing Ctrl + C.

1 comment:

  1. This guide was super helpful! I managed to get wf-recorder running on my Pi 5 without any hiccups. Really appreciate the clarity, especially with the yuzu ea reference it works flawlessly now!

    ReplyDelete

How Google Antigravity Solved the Mysterious NVIDIA Sleep Reboot on My Dell Inspiron 7567 (Ubuntu Linux)

If you run modern Ubuntu or Linux on a Dell Inspiron 15 Gaming (7567) or a similar 7th-gen Intel laptop paired with an NVIDIA GeForce GTX ...