ScreenshotNeo

BlogScreenshots on your device

How to Capture Screenshot Video on Linux

Record your Linux desktop with GNOME, OBS Studio, or FFmpeg. Choose the right method for X11, Wayland, windows, audio, and repeatable scripts.

By the ScreenshotNeo team1 October 20268 min read

Linux has three practical ways to capture screen video:

  • GNOME Screen Recording: fastest for a short desktop recording.
  • OBS Studio: best for selecting windows, mixing microphone and system audio, creating scenes, and streaming.
  • FFmpeg: best for repeatable command-line recordings on X11.

Your desktop session determines the correct path. X11 supports FFmpeg’s x11grab input. Wayland requires a recorder that uses PipeWire and the desktop portal, such as OBS Studio’s PipeWire source.

1. Check whether you are using X11 or Wayland

Run:

echo "$XDG_SESSION_TYPE"

The output is usually x11 or wayland.

  • x11: FFmpeg’s documented x11grab route works, and OBS can use XSHM sources.
  • wayland: use GNOME’s built-in recorder or OBS with its PipeWire capture source. Direct X11 grabbing is not the normal Wayland route.

Also identify your target before choosing a tool:

Goal Recommended method
Short whole-desktop clip on GNOME GNOME Screen Recording
One application window OBS Window Capture
Region with exact coordinates FFmpeg on X11 or an OBS crop
Microphone and system audio mixing OBS Studio
Repeatable scripted capture FFmpeg on X11
Streaming, scenes, overlays, or multiple sources OBS Studio

2. Fastest method: GNOME Screen Recording

GNOME describes screen recording as a system feature invoked by a shortcut. Red Hat documents it as a built-in GNOME feature for recording the desktop or application activity. Recordings are saved as WebM. See the GNOME screen recording documentation.

  1. Open the GNOME quick settings menu.
  2. Choose the screen-recording control, or use the recording shortcut configured by your desktop.
  3. Select the whole screen or the available capture area.
  4. Start the recording and perform the actions you need to show.
  5. Stop from the quick settings control or the active recording indicator.
  6. Open your Videos folder and verify the resulting .webm file.

GNOME’s recorder is ideal for a bug report, a short tutorial, or a quick reproduction clip. It has fewer controls than OBS: use OBS when you need a particular window, audio routing, scenes, or streaming.

GNOME recording checklist

  • Close private notifications and unrelated windows.
  • Set display scaling and application zoom before recording.
  • Confirm there is enough free disk space.
  • Make a short test clip and play it back before recording a long session.
  • Remember that the default output is WebM; convert it only when a destination requires another format.

3. Record with OBS Studio

OBS provides Linux Screen Capture (XSHM) for X11 and Linux Screen Capture (PipeWire) for Wayland. Its Window Capture source records a selected application window and its contents. See the OBS Studio documentation for current Linux source names and setup details.

Install OBS

Install OBS from your distribution’s package manager or the official OBS distribution for your Linux release. Start OBS after installation and complete the automatic configuration only if its suggested defaults match your recording goal.

Create a whole-screen source

  1. Open OBS and create a scene.
  2. Click Sources → +.
  3. On X11, choose Linux Screen Capture (XSHM).
  4. On Wayland, choose Linux Screen Capture (PipeWire) and approve the desktop portal’s screen-selection dialog.
  5. Select the display, set the desired frame rate and output resolution, and confirm.
  6. Check the preview for cropping, scaling, and black borders.

Record one application window

  1. Add Window Capture as a source.
  2. Select the application window from the list.
  3. Choose whether the source should follow the window title or a specific process when OBS offers those options.
  4. Resize or crop the source in the preview.
  5. Start a short test recording and verify that menus, dialogs, and pointer movement appear as expected.

OBS Window Capture is useful when the desktop contains confidential information or when you want a focused tutorial. Some applications render through unusual graphics paths and may not appear correctly; in that case, try a display capture and crop it, or change the application’s rendering mode.

Add microphone and system audio

  1. Open Settings → Audio.
  2. Choose the microphone under the microphone/auxiliary device.
  3. Choose the desktop or monitor source exposed by your audio stack for system audio.
  4. Speak and play a sound while watching the meters.
  5. Use the mixer to prevent clipping; peaks should remain below 0 dB.

Audio device names vary between PulseAudio, PipeWire, and distribution configurations. If the meter never moves, confirm the device is not muted in the system mixer and that OBS has permission to access it.

Choose recording format and quality

In Settings → Output → Recording, set the output directory, container, encoder, and quality. Prefer a recording-safe container for long sessions, then remux to a delivery format after recording if necessary. Match the frame rate and resolution to the material: a terminal tutorial usually needs less bandwidth than fast game footage.

4. Record from the command line with FFmpeg on X11

FFmpeg documents the X11 video input device as x11grab. The input accepts a display such as :0.0, a frame rate, a capture size, and an optional +x,y offset. See the FFmpeg device documentation.

Whole display

ffmpeg -f x11grab -framerate 30 -video_size 1920x1080 -i :0.0 \
  -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
  linux-desktop.mp4

Change 1920x1080 to your display size. If your display is exposed as another X display, replace :0.0.

Capture a rectangular region

ffmpeg -f x11grab -framerate 30 -video_size 1280x720 \
  -i :0.0+100,80 \
  -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
  region.mp4

The +100,80 offset starts 100 pixels from the left and 80 pixels from the top. The selected region must fit inside the display.

Capture microphone audio

Audio input names depend on your Linux audio stack. List PulseAudio-compatible sources with:

pactl list short sources

Then pass the selected source to FFmpeg, for example:

ffmpeg -f x11grab -framerate 30 -video_size 1920x1080 -i :0.0 \
  -f pulse -i YOUR_MONITOR_OR_MIC_SOURCE \
  -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
  -c:a aac -b:a 160k recording.mp4

Replace YOUR_MONITOR_OR_MIC_SOURCE with the exact source name returned by pactl. To capture both microphone and desktop audio, configure a combined source in your audio server or use OBS, which makes this routing easier to inspect.

Use a lossless intermediate

For editing or frame-accurate analysis, write a high-quality intermediate and encode a delivery copy later:

ffmpeg -f x11grab -framerate 60 -video_size 1920x1080 -i :0.0 \
  -c:v ffv1 -level 3 -g 1 -an capture.mkv

Lossless files are large. Use them only when the extra storage is justified.

5. Wayland and X11 edge cases

Wayland permissions

Wayland intentionally restricts direct screen access. When OBS uses PipeWire, approve the display or window in the desktop portal dialog. If no dialog appears, restart OBS and verify that the desktop portal and PipeWire services are running.

Multiple monitors

Capture each monitor as a separate source when you need independent layouts. For a single combined desktop, select the virtual display offered by GNOME or OBS and check the preview for differing scale factors.

HiDPI scaling

Logical resolution and physical pixel resolution can differ. A 200% scaled display may produce a capture size that surprises you. Check the actual source dimensions in OBS or with your desktop display settings, then set the output resolution deliberately.

Protected or hardware-rendered windows

Some applications do not expose their contents to window capture, or they render as a black surface. Try display capture and crop, disable application-specific hardware acceleration when acceptable, or record the application through its own export feature.

6. Performance, reliability, and storage

  • Frame rate: 30 fps is sufficient for most tutorials; 60 fps preserves fast pointer movement and animation but increases CPU, GPU, and storage use.
  • Resolution: capture at the size viewers need. Downscaling later costs time and disk space.
  • Encoder: hardware encoders reduce CPU load when supported, while software encoders offer consistent results across machines.
  • Disk throughput: write recordings to a fast local disk. Network mounts can introduce dropped frames.
  • Thermals: long recordings can raise CPU/GPU temperature and cause throttling. Watch OBS’s dropped-frame and encoding-lag indicators.
  • Reliability: make a short test, verify audio and video playback, and keep the source application in a known state before a long capture.
  • Storage: high resolution, high frame rate, and lossless codecs create very large files. Plan free space before starting.

The researched sources do not provide an authoritative performance benchmark, so select settings through a short local test instead of relying on a universal frame-rate or bitrate promise.

7. Troubleshooting

Symptom Likely cause Fix
GNOME recording does not start Shortcut or desktop integration differs Use the quick settings recording control and check keyboard-shortcut settings.
OBS shows no Wayland source PipeWire or the desktop portal is unavailable Restart the portal and PipeWire services, restart OBS, and approve the capture dialog.
FFmpeg says “No such file or directory” for :0.0 Wrong X display or no X11 session Confirm echo "$XDG_SESSION_TYPE"; use the correct DISPLAY value on X11 or switch to PipeWire capture on Wayland.
Captured video is black Window is protected or hardware-rendered Use display capture and crop, or adjust the application’s rendering settings.
Video has dropped frames Encoder or disk cannot keep up Lower resolution or frame rate, use a faster preset or hardware encoder, and record to a local fast disk.
No microphone audio Wrong source, mute, or permission Check OBS’s audio device, unmute it in the system mixer, and verify sources with pactl list short sources.
Audio and video drift Clock or load differences during a long capture Use one recorder for both streams, avoid overloaded encoders, and test the complete audio path before recording.
FFmpeg region is offset or clipped Incorrect dimensions or +x,y offset Check the display’s real pixel dimensions and keep the region inside its bounds.

8. Or skip the browser setup

If what you need is a clean still image of a web page rather than a recording of your Linux desktop, ScreenshotNeo returns a screenshot or PDF from one GET request. Its browser handles cookie and consent banners, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture. Only clean shots are billed; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

See the ScreenshotNeo API documentation for all options.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Python

import requests

r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo supports full-page and element captures, dark mode, device presets, retina scale, custom CSS and JavaScript, clicks, waits, blocked resources, headers, cookies, user agents, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous jobs, webhooks, bulk capture, usage reporting, PDFs, and HTML/CSS rendering. You can choose the options that match the page you need to document.

Try ScreenshotNeo free: 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 screenshots. Create your free ScreenshotNeo account.

9. FAQ

Can I record a single window on Wayland?

Yes. Use OBS with its PipeWire capture source and select the window through the desktop portal.

Does FFmpeg screen capture work on Wayland?

The documented x11grab method is for X11. On Wayland, use a PipeWire and portal based recorder such as OBS.

Which format does GNOME use?

GNOME’s built-in recorder saves WebM files.

Should I use OBS or FFmpeg?

Use OBS for windows, audio mixing, scenes, and streaming. Use FFmpeg when you need a repeatable X11 command with explicit size and frame-rate settings.

Can ScreenshotNeo record my Linux desktop?

No. ScreenshotNeo captures web pages as still images or PDFs. It is useful when your goal is a clean website image rather than a desktop video.