_ _ | |_ ___ __| |____ ___ _ _ | __/ _ \/ _` |_ / / _ \ | | | | || __/ (_| |/ / | __/ |_| | \__\___|\__,_/___(_)___|\__,_|
In this example, I'm going to set up Icecast as a streaming audio server on the local network, using ffmpeg running on the same machine as the audio source. In this case, ffmpeg will capture audio from the first audio capture device on the machine.
sudo apt install icecast2
As part of the installation, I was invited to set three different passwords. For the instructions below, let's assume the password I used was mypassword (it wasn't obviously).
I think this is how I started the icecast2 server...
sudo service icecast2 start
Check the icecast2 server is running by directing your browser to the following URL:
http://localhost:8000/
If you want to review the icecast config file, do the following:
sudo vim /etc/icecast2/icecast.xml
If you changed anything, restart icecast2 as follows:
sudo service icecast2 stop
sudo service icecast2 start
Run ffmpeg to capture audio from the mic and feed it to the icecast server:
ffmpeg -ac 1 -f alsa -i hw:0,0 -acodec libmp3lame -ab 32k -ac 1 -content_type audio/mpeg -f mp3 icecast://source:mypassword@localhost:8000/mystream
Then direct the browser to the following URL to play the audio stream.
http://localhost:8000/mystream
I found these three articles by Dom Robinson helpful:
I referred to this one also:
...and the Icecast documentation, e.g.