Posted on Leave a comment

VLC: HTTP Stream

This guide describes how to configure VLC Media Player as a streaming transmitter.

VLC Media Player is a free and open source cross-platform designed for multimedia functionalities. Besides the multimedia player, VLC contains a  broadcaster server that supports several streaming technologies. In this guide, we are going to explore, step by step, how to configure VLC for transmitting a local source to Broadcaster devices.

HTTP Stream

All Broadcaster devices support a variety of audio formats transported over HTTP connections and are compatible with both standard and IceCast GET requests. In this example, the VLC built-in HTTP server is configured to listen for incoming connections and forwards an MP3 source over an HTTP stream.

VLC opens TCP port 8080 and accepts HTTP requests by broadcasting Example.mp3[*].

.\vlc.exe .\Example.mp3 --sout '#http{mux=mp3,dst=:8080/}'

Same results using UI. Open VLC Media Player, click on Media menu, then on Stream (shortcut Ctrl+S).

Add a source (e.g. Example.mp3) and click on Stream button.

Now, you need to confirm the source summary with Next.

Select the HTTP streaming method, click Add, and finally Next button. In this example, the VLC server listens for incoming connections on port 8080 with basepath /.

In this example, we are not going to enable the transcoding because the destination matches the source codec (MP3). So leave Activate transcoding unchecked and click Next button.

To locally reproduce the stream check Stream all elementary streams otherwise leave it unchecked. Finally, click on Stream to start VLC media player as TCP HTTP Transmitter server.

The built-in HTTP server starts listening on port 8080, a GET request returns a standard HTTP header followed by the MP3 audio stream. In this example, the machine running VLC has a local IP 192.168.2.100, so a http://192.168.2.100:8080/ represents the URL to the local MP3 stream.

HTTP Stream with transcoding

VLC Media Player transcodes encoded sources into any desired format. In this example, we broadcast a FLAC stream coming from an MP3 source file.

By using the command line, we just need to add the transcode option:

.\vlc.exe .\example.mp3 --sout '#transcode{vcodec=none,acodec=flac,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=flac,dst=:8080/}'

Using the UI. Open VLC Media Player, click on Media menu, then on Stream (shortcut Ctrl+S).

Add a source (e.g. Example.mp3) and click on Stream button.

Now, you need to confirm the source summary with the Next button.

Select the HTTP streaming method, click Add, and finally Next button.

This time, we enable the transcoding option by checking the Activate transcoding. Then, select a predefined audio profile (e.g. Audio – FLAC) and confirm with Next.  By clicking Create a new profile you can create a custom profile with different bitrate, samplerate, and channel numbers, follow this guide.

Finally, click on Stream to start VLC media player as TCP HTTP Transmitter server and broadcast FLAC audio.

Broadcaster HTTP listening

To playback, an HTTP stream with your Broadcaster, connect to your device, select Receiver mode, insert the URL address (e.g. http://192.168.2.100:8080/) of your machine running VLC Media Player, click Connect from the Status page, and enjoy your music.

In this example, a Nano Broadcaster is configured to connect to a local machine running VLC Media Player.

[*] Thanks to Bensound.com. Original source: link.

Leave a Reply