Skip to content

Instantly share code, notes, and snippets.

@mijorus
Last active October 17, 2025 19:33
Show Gist options
  • Save mijorus/2db57837d3a7d5623a63e00c43086404 to your computer and use it in GitHub Desktop.
Save mijorus/2db57837d3a7d5623a63e00c43086404 to your computer and use it in GitHub Desktop.
How to stream a USB webcam from a raspberry pi over the network

How to stream a USB webcam from a raspberry pi over the network

I've struggled with this for a while, but I've finally found a good solution, which has low-latency and good image quality. I'm using a raspberry pi zero 2w with a USB camera.

Use ustreamer

ustreamer is a simple util that allows you to stream a video with very litte latency and a stable 30 fps even from the Pi Zero 2W.

sudo apt install ustreamer

# List all the available formats for your camera (replace video0 with what you need)
v4l2-ctl --device=/dev/video0 --list-formats-ext

# From this list, note if your camera supports MJPEG and select
# an available resoluzion and frame-rate

# Stream a MJPEG video from video0 at 30fps
# --host 0.0.0.0 exposes the stream on your local network
ustreamer -d /dev/video0 -m MJPEG -f 30 --encoder HW --host 0.0.0.0 --port 8080

Now visit with your browser or open with OBS: http://raspberrypi.local:8080/stream

Please note that softwares like OBS or VLC might add some buffering which would add delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment