Skip to content

zenxSrc/screenRecorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฅ Linux Screen Recorder (Industrial TUI)

A powerful, interactive terminal-based screen recorder for Linux (X11), built in C++17 + ncurses, powered by FFmpeg.

โšก Industrial-grade TUI โ€ข Keyboard + Mouse support โ€ข Safe & robust


โœจ Features

๐ŸŽฌ Recording Engine

  • FFmpeg-powered recording (libx264 + AAC)
  • Real-time screen capture via X11 (x11grab)
  • Automatic scaling (capture native โ†’ downscale if needed)
  • Clean shutdown via q (prevents corruption)

๐Ÿ–ฅ๏ธ Advanced TUI (ncurses)

  • Fully interactive multi-step UI
  • Keyboard + mouse support
  • Highlighted menus, dialogs, sliders, and input boxes
  • Help screen with full keybindings
  • Live status + structured workflow

โš™๏ธ Recording Configuration

๐Ÿ“บ Resolution Options

  • 720p / 1080p / 1440p / 4K
  • Native screen resolution (auto-detected)

๐ŸŽž๏ธ Frame Rate Control

  • 24 FPS (cinematic)
  • 30 FPS (balanced)
  • 60 FPS (smooth gameplay)

๐Ÿ”Š Audio System

  • No audio mode
  • Default system audio (PulseAudio monitor)
  • Custom audio device selection (auto-detected sinks)

๐ŸŽš๏ธ Encoder & Quality Control

  • Presets:

    • Ultrafast / Fast / Medium / Slow
  • CRF slider (0โ€“51) for fine quality control

  • Toggle mouse cursor visibility

  • Pixel format optimized for compatibility (yuv420p)


๐Ÿ“ Output Management

  • Interactive filename input

  • Auto .mp4 handling

  • Path validation:

    • Prevents invalid characters
    • Checks directory existence
    • Verifies write permissions
  • Overwrite confirmation dialog


๐Ÿ” Smart System Detection

  • Auto-detects:

    • Screen resolution (xdpyinfo / xrandr)
    • DISPLAY environment
    • PulseAudio monitor device
  • Lists available audio sinks dynamically


๐Ÿงช Built-in Safety Checks

  • Dependency checker (ffmpeg, pactl, xdpyinfo)
  • Disk space validation (warns < 500MB)
  • Terminal size validation
  • Input sanitization (prevents unsafe filenames)

๐Ÿงพ Logging System

  • Persistent logs:

    ~/.screen_recorder.log
    
  • Includes:

    • Command execution
    • Errors & warnings
    • Runtime events

๐Ÿงต Performance & Architecture

  • Multi-threaded design
  • Atomic state management
  • Safe subprocess handling
  • Efficient FFmpeg pipeline

๐Ÿ“ฆ Requirements

  • Linux (X11 required โ€” โŒ Wayland not supported)
  • FFmpeg (libx264 + aac)
  • PulseAudio (pactl)
  • ncurses
  • xdpyinfo or xrandr

๐Ÿ”ง Install Dependencies

๐ŸŸข Arch / Manjaro

sudo pacman -S ffmpeg ncurses libpulse

๐Ÿ”ต Ubuntu / Debian

sudo apt install ffmpeg libncurses-dev pulseaudio-utils x11-utils

โš™๏ธ Build

g++ -std=c++17 -O2 -o screen_recorder screen_recorder.cpp \
-lncurses -lpanel -lmenu -lform -lpthread

โ–ถ๏ธ Usage

./screen_recorder

๐Ÿงญ Workflow

  1. Dependency check
  2. Select resolution
  3. Select frame rate
  4. Choose audio source
  5. Configure encoder (preset + CRF + cursor)
  6. Enter output filename
  7. Review summary + FFmpeg command preview
  8. Start recording

๐ŸŽฎ Controls

General Navigation

  • โ†‘ / โ†“ / j / k โ†’ Navigate
  • Enter / Click โ†’ Select
  • b / Backspace โ†’ Go back
  • q / Esc โ†’ Quit
  • ? / h โ†’ Help screen

Encoder Screen

  • - / + โ†’ Adjust CRF
  • โ† / โ†’ โ†’ Adjust slider
  • C โ†’ Toggle cursor

Recording

  • q โ†’ Stop recording safely
  • โš ๏ธ Avoid Ctrl+C (may corrupt file)

๐Ÿ“ค Output

  • Default: recording.mp4

  • Supports full paths:

    ~/Videos/output.mp4
    

After recording:

  • Shows file size
  • Provides playback commands (mpv / vlc / ffplay)

๐Ÿšซ Limitations

  • Wayland not supported
  • No microphone input (system audio only)
  • No region/window capture (full screen only)

๐Ÿš€ Future Improvements

  • Wayland support
  • Microphone input
  • Region/window recording
  • Hardware acceleration (VAAPI / NVENC)

๐Ÿ“œ License

MIT License


๐Ÿ‘จโ€๐Ÿ’ป Author

Built with ๐Ÿ’ป + โ˜• by Dip

About

๐ŸŽฅ High-performance, zero-dependency C++ screen recorder for Linux. Low CPU usage, CLI-based.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages