Simple Media Streaming with VLC and IceCast

Coffman
6 min readSep 19, 2018

--

VLC and IceCast — Simple Streaming

The number of streaming platforms has exploded over the years.

  • iHeartRadio
  • Pandora
  • Spotify
  • NextRadio
  • TuneIn
  • TuneGenie
  • Last.FM

and so many more.

UPDATE:
After completing this story, I found a piece of software that might make streaming a bit simpler. It is called SoundWire from GeorgieLabs (http://georgielabs.net/).

Turn your Android device into wireless headphones / wireless speaker. Stream any music or audio from your PC to your Android phone, tablet, or other PCs. SoundWire does audio mirroring (audio cast). You can use any music player on your PC or laptop like Spotify, YouTube, or iTunes and stream low-latency live sound over WiFi directly to your Android device. Also works over 3G/4G cell networks or WAN.

I added experimentation of SoundWire on my to-do list. In the meantime, here is a good article on SoundWire.

Let’s Get Start — Streaming My Music

Let’s Get Start — Streaming My Music

At one point, I decided to stream my music over my network. It wouldn’t be much work to create an actual public station. I am not interested in listening to music as opposed to paying royalties.

You want to do your own streaming with your own music. I am going to describe the steps I performed to do my own streaming of music.

Requirements

  1. First and foremost, you need a collection of songs. Streaming is pointless without audio/videos to stream. In my case, I had several thousand MP3 files collected over the last 15 years.
  2. A machine with audio card. It sounds silly to list this requirement but it is best to be safe.
  3. VLC Media Player
  4. IceCast (http://icecast.org/).

Installation and Configuration of IceCast

Icecast is a great free streaming media server. Although free, it can be feel clunky and overwhelming as there isn’t really any UI. Instead, there is an XML file that needs to be updated using your favorite text/XML editor.

The first step is the configuration of Icecast. The XML file containing the configuration settings can look complex. But there are really only a few lines that need to be changed.

First Change - Hostname

Let’s start with the setting of the Hostname. The hostname can be a domain name, hostname of the PC, or the IP Address. The IP Address is subject to change if using DHCP.

Second Change — Password

Security is important. Uninvited guests should not have access. So let’s set a password for the source. If desired, feel free to change the username and password for the Admin logs as well.

Third Change — IP and Port

Save the XML file. That’s it for the configuration of IceCast. Start the IceCast server and see the window below.

Main Window for IceCast Server

If you are interested in learning more about the setup of IceCast, I would advise you to go the website (http://icecast.org/). Below is a link to the basic setup for the latest documentation.

Installation and Configuration of VLC Media Player

Open a web browser and navigate to https://www.videolan.org/vlc/.

For those that use Chocolatey, VLC Media Player has a Chocolatey package. choco install vlc

Start VLC Media Player.

We need to select the audio to be streamed. Click on the Media menu (top-left) and select the desired option. For your collection of audio, select “Open File…” or “Open Multiple Files…”

Let’s select the audio/video to be streamed.

Look at the very bottom of the window for the Play button. Click the down arrow beside the word Play. A list of options will be displayed. Select the Stream option.

At this point, we are using the wizard in VLC Media Player to configure the streaming output. Click the Next button.

We need to configure the destination. VLC Media Player offers a variety of choices. HTTP, RTSP, RTP, and more. Since we are using IceCast, let’s select the IceCast option.

We need to enter the data for the IceCast server. Think back to the configuration of the IceCast server. There were a few lines of XML that were updated. To make things simple, here is a list of the values.

Address = <bind-address>
Port = <port>
Mount Point = stream
Login:pass = username is source and password is <source-password>

Click the Next button.

The Transcoding Options refer to the audio format for the stream. Again, VLC Media Player offers a variety of options. I like to use MP3 so I use the default.

At this point, we are ready to stream the audio to IceCast. The last step is to press the Stream button.

Summary

At this point, I am able to connect to the stream on any computer or mobile device that has an audio player that supports streaming. I went into VLC on my laptop, select the option for network, and entered the following URL.

http://10.10.10.10:4000/stream.m3u

Just to recap, the streaming is only on my network. If I am sitting in my office at work, I cannot connect to the stream.

My setup wasn’t quite as smooth as described in this article. I had issues with my audio card as well as web server issues. The biggest issue for me was the web server as I didn’t have IIS properly configured.

If you have issues, don’t give up. A quick google search is an excellent way to resolve the problem. If you had the issue, it is likely someone else had the same issue.

Links to Resources

--

--

Coffman

I am a father and geek who loves his job and technology. What more can I say?