Knowledge Base

Use FFmpeg to stream your webcam on Ubuntu with RTMP

You could always use OBS from any GUI for Ubuntu to stream the live feed of your webcam. But what if you didn't install Ubuntu with a GUI? But even more important, why use OBS that uses a lot of resources when you can use this simple command to stream your webcam using a lot less resources? In any case, here's a simple command that streams your /dev/video0 device (usually your webcam) to an RTMp server running on the same host.

ffmpeg -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -threads 0 -f flv "rtmp://127.0.0.1/stream/webcam"
Table of Contents