Set Icecast Mount, Password, and Content Type in FFmpeg

Streaming live audio to an Icecast server using FFmpeg requires configuring specific parameters to ensure proper authentication and routing. This guide explains how to define the mount point, source password, and audio content type directly within your FFmpeg command-line arguments for seamless broadcasting.

The Icecast URL Structure (Mount Point and Password)

In FFmpeg, the mount point, username, and password are set directly within the output URL using the Icecast protocol handler. The standard syntax for the destination URL is:

icecast://username:password@host:port/mountpoint

Setting the Content Type

To tell the Icecast server and connecting clients what audio format you are streaming, you must use the -content_type flag in FFmpeg. This flag maps directly to the HTTP Content-Type header.

Common content types include: * MP3: -content_type audio/mpeg * Ogg/Vorbis or Ogg/Opus: -content_type audio/ogg * AAC: -content_type audio/aac or -content_type audio/aacp

This flag must be placed before the output Icecast URL in your command line.

Complete FFmpeg Command Example

Below is a practical command that transcodes an input audio source into a 128kbps MP3 stream and sends it to an Icecast server:

ffmpeg -re -i input.wav -c:a libmp3lame -b:a 128k -content_type audio/mpeg -f mp3 icecast://source:your_secure_password@yourserver.com:8000/live.mp3

Command Breakdown: