Stream Video to Icecast Using FFmpeg

This article provides a direct, step-by-step guide on how to stream live video to an Icecast server using the native Icecast protocol in FFmpeg. You will learn the exact FFmpeg command structure, the required video and audio codecs, and how to configure your output parameters to successfully broadcast WebM or Ogg video streams.

To stream video to Icecast, you must use a container format and codecs that Icecast supports, typically WebM (VP8 video and Vorbis/Opus audio) or Ogg (Theora video and Vorbis audio). Modern implementations favor the WebM format.

Here is the standard FFmpeg command to stream a video file or live input to an Icecast server using WebM:

ffmpeg -re -i input.mp4 -c:v libvpx -b:v 1M -c:a libvorbis -b:a 128k -f webm -content_type video/webm icecast://source:your_password@your_server_ip:8000/stream.webm

Command Breakdown

Alternative: Streaming Ogg/Theora

If you prefer using the older Ogg/Theora format, modify the codecs and container parameters as follows:

ffmpeg -re -i input.mp4 -c:v libtheora -q:v 6 -c:a libvorbis -q:a 4 -f ogg -content_type video/ogg icecast://source:your_password@your_server_ip:8000/stream.ogv

Ensure that your Icecast configuration (icecast.xml) has enough bandwidth and limit settings allowed for video streams, as video requires significantly more throughput than standard audio-only streams.