How to record your webcam on Linux

On Linux, webcams use the Video4Linux2 (V4L2) driver and appear as /dev/video0, /dev/video1 and so on. Any app that speaks V4L2 can record them – from simple GUI apps to a single ffmpeg command. Below are the quickest options, the exact commands, and fixes for the usual permission and format problems.

Try It Now - Free Webcam Recorder

Ready to record

Click the button below to start

🔒 Your camera feed and recordings never leave your device. All processing happens locally in your browser.

Option 1: GUI apps

  • GNOME Camera (Snapshot) – the default camera app in GNOME 45 and later. Open it, switch to video mode with the toggle next to the shutter, click record. Videos go to ~/Videos/Camera.
  • Cheese – the older GNOME webcam app, still packaged by most distros (sudo apt install cheese). Click Video, then Start Recording; files go to ~/Videos/Webcam.
  • Guvcview – exposes resolution, frame rate, codec and camera controls such as exposure and focus (sudo apt install guvcview). Press the Video button to record.
  • OBS Studio – add a Video Capture Device (V4L2) source if you need overlays or want to record the webcam and screen together.

Option 2: Find your camera and its formats

sudo apt install v4l-utils ffmpeg      # Debian/Ubuntu; use dnf or pacman on other distros
v4l2-ctl --list-devices                # shows camera names and /dev/videoN nodes
v4l2-ctl -d /dev/video0 --list-formats-ext   # resolutions and frame rates (YUYV, MJPG)

Option 3: Record with one ffmpeg command

ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video0 \
       -f pulse -i default \
       -c:v libx264 -preset veryfast -crf 23 -c:a aac -b:a 128k webcam.mp4

# Press q to stop. Without a microphone, drop the '-f pulse -i default' line and '-c:a aac -b:a 128k'.

Why these ffmpeg options matter

  • -input_format mjpeg: most USB webcams only deliver 720p/1080p at 30 fps in MJPEG; raw YUYV is often limited to 5–10 fps at high resolutions.
  • -f pulse -i default: records the default microphone. This also works on PipeWire systems through pipewire-pulse. Use -f alsa -i hw:1 for a specific ALSA card.
  • -preset veryfast -crf 23: keeps CPU usage low enough to avoid dropped frames while giving a good size/quality balance.

Option 4: Record in the browser

  1. Open this page in Firefox or Chrome and click Start Camera in the recorder above.
  2. Allow camera and microphone access, click Record Video, then Stop Recording and Download.
  3. If you use a Flatpak or Snap browser, give it camera access first (Flatseal for Flatpak, snap connect for Snap).

Troubleshooting

  • Permission denied on /dev/video0: add yourself to the video group with sudo usermod -aG video $USER, then log out and back in.
  • Device or resource busy: another app holds the camera. Run fuser /dev/video0 to see which process.
  • Two /dev/video nodes per camera: newer kernels expose a metadata node as well. Use the one that lists formats with v4l2-ctl.
  • Dark or flickering image: set the power-line frequency with v4l2-ctl -d /dev/video0 -c power_line_frequency=1 (50 Hz) or =2 (60 Hz).

Frequently Asked Questions

What is the simplest way to record a webcam on Ubuntu?

On recent Ubuntu releases, open the Camera app from the app grid, switch to video and click record. On older releases, install Cheese with sudo apt install cheese.

How do I record only video, without audio, using ffmpeg?

Leave out the audio input: ffmpeg -f v4l2 -input_format mjpeg -video_size 1280x720 -i /dev/video0 -c:v libx264 -preset veryfast webcam.mp4

Which device is my external USB webcam?

Run v4l2-ctl --list-devices. The USB camera is listed with its product name and its /dev/videoN nodes; the built-in camera of a laptop is usually /dev/video0.

Related Topics