Confirm the kernel sees the camera
Before touching the browser, check the device exists at system level. In a terminal:
| Command | What it tells you |
|---|---|
| ls /dev/video* | Whether video devices exist at all. Nothing listed means the kernel has not detected a camera. |
| lsusb | Whether a USB webcam is detected on the bus, even without a driver. |
| v4l2-ctl --list-devices | Named devices with their nodes. Part of the v4l-utils package. |
| lsmod | grep uvcvideo | Whether the standard USB camera module is loaded. |
If lsusb shows the camera but /dev/video* is empty, the uvcvideo module is not loaded. Load it with sudo modprobe uvcvideo.
Multiple /dev/video nodes is normal. A single webcam commonly registers two or more nodes, and only the first usually carries video; the others expose metadata. If an application picks the wrong one you get a black image. Selecting a different entry in the camera source list above will often fix it immediately.
Permissions
Video devices belong to the video group on most distributions. Your user must be in it:
- Run groups to see your current groups.
- If video is missing, run sudo usermod -aG video $USER.
- Log out and back in. The change does not apply to an existing session.
- Retest.
Snap and Flatpak browsers
This is the cause people spend longest on. Browsers installed as Snap or Flatpak packages run sandboxed, and the sandbox may not grant camera access by default. Ubuntu ships Firefox as a Snap, so this affects a very large number of users.
For Flatpak, check the permission with flatpak info --show-permissions and grant camera access using Flatseal, which is far easier than editing overrides by hand. For Snap, connect the camera interface with sudo snap connect firefox:camera, substituting your browser's snap name.
A quick way to identify this: install the distribution package or a different browser and test again. If the camera works there, the sandbox was the problem.
Testing outside the browser
A black image from a working device usually means the wrong node or another app. Cheese, Guvcview and VLC can all open a camera directly. If they work but browsers do not, the fault is browser sandboxing or a browser permission rather than the driver. If nothing can open the camera, the problem is below the browser and the kernel checks above are the place to look.
Format negotiation
Some webcams only deliver certain resolutions in MJPEG rather than raw YUYV, and a browser requesting an unsupported combination gets nothing. Running v4l2-ctl --list-formats-ext shows exactly what your camera supports. The test above retries with relaxed settings if the first request fails, which works around most of these cases.
Common questions
No /dev/video device exists.
The uvcvideo module is probably not loaded. Run sudo modprobe uvcvideo, then check again with ls /dev/video*. If lsusb does not show the camera either, it is a hardware or connection problem.
Firefox cannot see my camera but Cheese can.
Almost certainly Snap or Flatpak sandboxing. Connect the camera interface with snap connect, or grant camera permission with Flatseal for Flatpak.
Why does my webcam create several /dev/video nodes?
Modern kernels register additional nodes for metadata alongside the video stream. Only one carries the image, so if an app picks the wrong one you get a black screen. Switch source in the list above.
Permission denied when opening the camera.
Your user is probably not in the video group. Run sudo usermod -aG video $USER, then log out and back in for it to apply.