Test Your Webcam from the Terminal with ffplay

Open a live preview window of /dev/video0 in one command to confirm the camera works before joining a video call.

LinuxwebcamffplayclicameraLow risk
Run ffplay -f v4l2 -i /dev/video0 to open a live webcam preview; press q to close it.

01Command

Command
$ ffplay -f v4l2 -i /dev/video0

02What it does

ffplay ships with ffmpeg and doubles as the quickest camera diagnostic on Linux: it opens a bare preview window straight from the V4L2 device with no browser permission dialogs. If the window stays black or ffplay says the device doesn't exist, run v4l2-ctl --list-devices (from v4l-utils) to find the right node — many laptops expose several /dev/videoN entries, and only one delivers the picture. Press q to quit the preview.

03Risk

RiskLow risk
Requirementsffmpeg (provides ffplay); a V4L2 webcam at /dev/video0 (sudo apt install ffmpeg / sudo dnf install ffmpeg)
!Warning: The preview holds an exclusive-ish lock on the camera; close ffplay before starting your meeting app or the conferencing software may fail to open the device.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • ffplay(1) — Linux manual page
    Arch Linux · community · 2026-09-17
    Evidence: ffplay is a minimal media player built on ffmpeg; -f v4l2 selects the Video4Linux2 input and -i the device file to display live.
  • v4l2-ctl(1) — Linux manual page
    Arch Linux · community · 2026-09-17
    Evidence: v4l2-ctl --list-devices enumerates video capture devices and their capabilities when /dev/video0 doesn't show a picture.

Last verified: 2026-09-18 · Category: Media