Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Connect a UVC-compatible USB webcam to the Raspberry Pi, confirm that Raspberry Pi OS exposes it through Video4Linux2 (usually /dev/video0), and choose a stream that matches the viewer: MJPEG over HTTP for a browser, or UDP, TCP, or RTSP for VLC and ffplay. Keep both devices on the same LAN, and adapt capture commands to the webcam’s actual format and capabilities.

What you need

  • A Raspberry Pi running Raspberry Pi OS.
  • A Linux/UVC-compatible USB webcam.
  • A wired or wireless local network shared by the Pi and viewing device.
  • A viewing device with a browser, VLC, or ffplay.
  • An optional powered USB hub if the camera and other peripherals need more USB power.

The simple examples below are for local-network use. They do not provide authentication or internet-safe access controls.

Install and verify the USB camera

USB webcams are normally accessed through Linux V4L2, not through the CSI-camera-only assumptions of rpicam. Install utilities and add your account to the video-device group:

sudo apt update
sudo apt install fswebcam v4l-utils
sudo usermod -a -G video "$USER"

Log out and back in (or restart the Pi) after changing group membership. Then inspect the camera and capture a still image:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
innomaker 1080P USB2.0 UVC Camera, 130° Wide Angle Camera, Plug & Play for PC, Raspberry Pi, Jetson Nano and SBCs. Support Windows, Linux, Android and Mac OS.
  • 【Native UVC Compliance】High-Speed USB 2.0 Interface, Native driver on Windows 11/10/7, Mac OS, Linux, Ubuntu and Android system. Direct integration with Raspberry Pi, Jetson Nano, Notebook, Desktop and industrial SBCs.
  • 【Superior Performer】Up to 1080P*30 fps. Support YUY2 and MJPEG format. Designed to perform reliably in both Indoor and Outdoor environments.
  • 【Wide Angle Lens】Fov(D) = 130 degrees and Fov(H) = 103 degree, with industry-standard M12 lens thread for optical customization.
  • 【OEM-Ready Design】32x32mm PCB with 4x M2 holes. You also could buy the matching metal housings on our Amazon shop separately.
  • 【Compliance And Safety】FCC/CE/UKCA certified, RoHS & REACH-SVHC compliant, tested by accredited labs.
v4l2-ctl --list-devices
ls -l /dev/video*
fswebcam image.jpg

A working webcam commonly appears as /dev/video0, but the number can differ when several video devices are attached. Use the device path reported by v4l2-ctl in later commands.

If no /dev/video* device appears

  • Reseat the USB cable and try another port.
  • Use a powered hub if the camera draws more power than the Pi can supply reliably.
  • Check permissions and confirm that you logged in again after adding the video group.
  • Stop applications that may already have the camera open.
  • Run v4l2-ctl --list-devices again after reconnecting the webcam.

Choose a streaming method

Method Best viewer Typical role Trade-off
MJPEG over HTTP Web browser Simple dashboard or one-off LAN viewing JPEG-per-frame transmission can use more bandwidth than an inter-frame codec
UDP ffplay or compatible player Low-latency direct playback Packets can be lost; setup depends on client codec support
TCP ffplay or VLC Reliable delivery when occasional delay is acceptable Retransmission can increase latency
RTSP VLC, ffplay, NVR software Clients that expect an RTSP URL More moving parts than browser-based MJPEG

Option A: View the webcam in a browser with MJPEG

mjpg-streamer sends a sequence of JPEG images over HTTP. A typical UVC input and HTTP output command is:

mjpg_streamer 
  -i "./input_uvc.so -d /dev/video0 -r 1280x720 -f 15" 
  -o "./output_http.so -p 8080 -w ./www"

Open http://PI_IP_ADDRESS:8080/ on a device connected to the same LAN. Replace the plugin paths, device, resolution, frame rate, and port with values supported by your installed build and webcam. If the camera rejects 1280×720 at 15 frames per second, choose a mode listed by the camera’s V4L2 controls.

This is generally the quickest route to a browser preview. Because every frame is transmitted as a JPEG, it may consume substantially more network capacity than H.264 at comparable image quality.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
InnoMaker 720P USB 2.0 UVC Camera with 120° DFOV for Raspberry Pi, Jetson Nano, Embedded Hardware - Support Windows, Linux, Mac OS, Android
  • 【Plug & Play USB Device】High-Speed USB 2.0 Interface, Native driver on Windows 11/10/7, Mac OS, Linux, Ubuntu and Android system. Raspberry Pi, Jetson Nano, Notebook, Desktop and Tablet PC.
  • 【Superior Performer】Up to 720P@30fps video streaming with simultaneous YUY2 & MJPEG formats over USB 2.0 interface. Ideal for machine vision and edge AI applications.
  • 【Wide Angle Lens】Fov(D)=120 degrees and Fov(H)=102 degree, with industry-standard M12 lens thread for optical customization.
  • 【Stable and Flexible】32*32 mm compact size, Easy to be installed in various occasions. You also could buy the matching metal stamping shell (ASIN:B0CLXV25NR) on our Amazon shop separately.
  • 【Compliance And Safety】FCC/CE/UKCA certified, RoHS & REACH-SVHC compliant, tested by accredited labs.

Option B: Send a direct UDP stream

Raspberry Pi’s documented low-latency pattern for an H.264 stream is:

rpicam-vid -t 0 -n --inline -o udp://CLIENT_IP:PORT

That command targets a Raspberry Pi camera pipeline. A USB webcam requires a V4L2-based FFmpeg or GStreamer capture pipeline that reads /dev/video0, encodes the video, and emits the same chosen transport. On the receiving computer, the corresponding playback pattern is:

ffplay udp://@:PORT -fflags nobuffer -flags low_delay -framedrop

Use the Pi’s actual LAN address and a port allowed by the local firewall. If the receiver does not handle an unencapsulated H.264 stream correctly, use MPEG-2 transport-stream encapsulation in the capture pipeline and open the resulting UDP stream in VLC.

Option C: Use TCP for reliable delivery

The documented TCP server pattern is:

rpicam-vid -t 0 -n --inline --listen -o tcp://0.0.0.0:PORT

A matching ffplay client is:

ffplay tcp://PI_IP_ADDRESS:PORT -vf "setpts=N/30" -fflags nobuffer -flags low_delay -framedrop

Again, substitute a USB-compatible V4L2 capture and encoding pipeline for the rpicam-vid capture side. For broad player compatibility, Raspberry Pi documents MPEG-2 transport-stream output:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Arducam 4K 8MP IMX219 Autofocus USB Camera Module with Metal Case, 1080P Mini UVC USB2.0 Video Webcam with Microphone, 3.3ft/1m Cable for Computer, Laptop, Raspberry Pi, Jetson Nano
  • More than HD: This camera adopts an 8MP IMX219 sensor for sharp image and accurate color reproduction, Max. still resolution 3264H x 2448V.
  • Autofocus: Shoot objects at millimeter level and in the distance on the same camera, automatically controlled without lens adjustment tool, closer and easier than the fixed focus camera.
  • Capture Video with Audio: Built with microphone, capture video with audio. Frame Rates: MJPG 15fps@3264 x 2448, 30fps@1080P/720P; YUY2 30fps@640 x 480/800 x 600;
  • Plug & Play: Ready to use, UVC-compliant, just connect the camera to PC, laptop, Android device, or Raspberry Pi with the included USB cable without extra drivers to be installed.
  • Applications: Assemble with a metal case and rotatable bracket, this mini-sized camera is highly recommended for a home surveillance system, monitoring 3D Printer, and you can easily put it on the desk or any flat surface, or mount it on the wall or tripod mount.
rpicam-vid -t 0 -n --codec libav --libav-format mpegts 
  -o tcp://0.0.0.0:PORT?listen=1

Open that stream in VLC with:

vlc tcp://PI_IP_ADDRESS:PORT

TCP avoids loss caused by dropped UDP packets, but waiting for retransmissions can make motion appear later than the camera captured it.

Option D: Serve the stream through RTSP and VLC

RTSP is useful when the viewer or recording software already expects an RTSP URL. Raspberry Pi’s documented VLC pattern accepts an MPEG-2 transport stream:

rpicam-vid -t 0 -n --codec libav --libav-format mpegts -o - 
  | cvlc stream:///dev/stdin 
    --sout '#rtp{sdp=rtsp://:8554/stream1}'

View it with either client:

ffplay rtsp://PI_IP_ADDRESS:8554/stream1 
  -fflags nobuffer -flags low_delay -framedrop
vlc rtsp://PI_IP_ADDRESS:8554/stream1

For a USB webcam, replace the rpicam-vid producer with a V4L2 capture and encoder that supplies the MPEG-2 transport stream to VLC. RTSP adds a server pipeline, but it fits multi-purpose media players and surveillance software better than an MJPEG page.

Network and security checks

  • Find the Pi’s LAN address with hostname -I and use the correct address in the client URL.
  • Confirm that the Pi and viewer are on the same router or otherwise have a route between their private addresses.
  • Ensure the selected TCP or UDP port is not blocked by a host firewall.
  • Bind only to interfaces needed for local viewing. Do not expose an unauthenticated stream directly to the internet.
  • For several viewers, check whether the chosen server supports multiple clients; a direct UDP or TCP sender may be intended for one receiver.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a blank, frozen, or incompatible stream

The camera opens but the stream fails

Check the webcam’s supported pixel formats, sizes, and frame rates with V4L2 tools, then lower the requested resolution or frame rate. A command that works for one UVC model is not guaranteed to work for another.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
InnoMaker USB 2.0 UVC Camera Board 1080P Day&Night Vision Automatic IR-Cut, MEMS Microphone ESD/EMI-Protected Plug&Play for Windows/Linux/Mac/Android/Raspberry Pi/Jetson Nano/ARM Boards
  • 【Wide Compatibility】Works with Windows 11/10/7, Mac OS, Linux, Ubuntu, and Android. Fully compatible with Raspberry Pi, Jetson Nano, ARM boards, notebooks, desktops, and tablets. Plug & Play with native UVC driver, no additional software required.
  • 【High-Definition Performance】Captures video up to 1080P@30fps with support for YUY2 and MJPEG formats, plus multiple optional resolutions to fit your needs. High-quality, low-noise MEMS microphone for clear and natural sound capture.
  • 【Day & Night Vision with Auto IR-Cut】Automatically switches between vivid daytime colors and clear night vision. Night mode can be set to color or black & white via the on-board jumper.
  • 【Wide Angle Lens】Fov(D) = 110 degrees and Fov(H) = 95 degree.
  • 【Enhanced Protection】On-Board Common Mode Filter, Provide ESD/EMI protection on high-speed differential signal lines for improved electrostatic discharge protection and reduced signal noise, ensuring stable performance in various environments.

The browser page does not load

Verify that mjpg_streamer is running, that its HTTP port matches the URL, and that you used the Pi’s LAN address rather than localhost on the viewing computer. Also confirm that the web-root path and plugin files match the installed package.

ffplay reports missing frames or shows excessive delay

For UDP, check the destination address, port, and Wi-Fi quality. The -fflags nobuffer -flags low_delay -framedrop options favor responsiveness over preserving every frame. For TCP, delay can result from retransmission; try UDP when occasional packet loss is acceptable.

VLC will not recognize the video

Use MPEG-2 transport-stream encapsulation when the client does not accept raw H.264. Confirm that the USB capture pipeline is actually producing the format expected by VLC or the RTSP server.

Raspberry Pi OS version caveat

Raspberry Pi’s plug-and-play USB-webcam tutorial states: “This tutorial was written for Raspberry Pi OS Bullseye and has not yet been updated for our latest operating system, Bookworm.” On Bookworm or later, prefer the current camera-software and V4L2 documentation, verify package names, and treat legacy-camera instructions as version-specific.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which method should you use?

  • Choose MJPEG HTTP when the main requirement is opening a live view in a browser with minimal client setup.
  • Choose UDP when low delay matters more than perfect delivery and the player accepts the selected codec.
  • Choose TCP when reliable delivery is more important than the lowest possible delay.
  • Choose RTSP when VLC, ffplay, a recorder, or another application already expects an RTSP endpoint.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.