A lightweight, dependency-free (except FFmpeg) command-line screen recorder for Linux (X11) with a simple interactive TUI menu.
- Records at 60 FPS using libx264 (CRF 23 β good quality/size balance)
- Choice of resolution: 720p, 1080p, or native screen resolution
- Optional system audio capture (via PulseAudio monitor source)
- Clean stop with 'q' key (recommended) to avoid video corruption
- Very low CPU usage thanks to ultrafast preset
- Single-file C++17 source β easy to compile and run
- Colorful terminal interface with clear instructions
- Linux with X11 (Wayland not supported)
- FFmpeg installed (
libx264andaacencoders must be available) xdpyinfoorxrandr(usually pre-installed) for resolution detection- PulseAudio (for system audio capture)
sudo apt update
sudo apt install ffmpegClone the repository:
git clone https://github.com/zenxSrc/screenRecorder.git
cd screenRecorder
Compile the single source file:
g++ -std=c++17 -O2 recorder.cpp -o screenrecorder
(You can also use -Wall -Wextra for stricter warnings if desired)
./screenrecorder
Follow the on-screen prompts:
- Choose video quality (720p / 1080p / Native)
- Choose whether to record system audio
- Enter output filename (defaults to recording.mp4)
- Press ENTER to begin recording
- Press q in the FFmpeg terminal window to stop gracefully
Example Output Filename
- If you leave the filename blank β saves as recording.mp4
- You can also specify full paths: ~/Videos/my_gameplay.mp4
- X11 only (no Wayland support yet)
- No microphone input (system audio only when enabled)
- No advanced encoding options (tuned for simplicity & performance)
Fedora:
sudo dnf install ffmpeg gcc-c++
Arch:
sudo pacman -S ffmpeg gcc
Feel free to open issues or pull requests β especially welcome are Wayland support or additional features while keeping it minimal.
MIT License