forked from StreamMachine/StreamMachine
-
Notifications
You must be signed in to change notification settings - Fork 0
Setting up a local stream with VLC or LiquidSoap
Avanish Pathak edited this page Apr 22, 2016
·
4 revisions
- Install the latest version of VLC.
- Make the
vlc
command available to you. I recommend creating a symlink at/usr/local/bin/vlc
to theVLC
binary inside the VLC.app package, eg./Applications/VLC.app/Content/MacOS/VLC
- Start the StreamMachine server in standalone mode (see the StreamMachine README for details). It'll probably be something like:
./streammachine-cmd --config ./config/standalone.json
- Visit the StreamMachine Admin UI at
/admin
. Either create a stream or confirm that one is already present and waiting for a Source. Also make note of its stream key and audio type.
Start a stream via VLC, with the following sout
configuration:
Config | Description |
---|---|
mux | The type of encapsulation to wrap around the audio stream. For MP3 files, use dummy . |
dst | A source specifying the ip/port that your StreamMachine instance is listening to for a source, along with the password and stream name. |
access | Set to shout , which tells VLC to forward the stream to an "Icecast" server (which is actually the StreamMachine server, pretending to be Icecast). See here for more info: https://github.com/videolan/vlc/blob/master/modules/access_output/shout.c
|
- Stream a local mp3 file:
vlc --repeat airtalk_episode.mp3 --sout \
'#standard{mux=dummy,dst=source:[email protected]:8002/streamname,access=shout}'
- You can also connect to a remote live stream:
vlc http://live.scpr.org/kpcclive --sout \
'#standard{mux=dummy,dst=source:[email protected]:8002/streamname,access=shout}'
-
Visit the VLC Web Interface, by default at http://localhost:8080. You may need to set a password in the
vlc
command with thehttp-password
option. You can also open the VLC OS X client and configure the password there. -
Play the file. Check the StreamMachine output to make sure that everything is connecting properly and that the Source was registered and activated.
Your stream should now be audible at the configured port/stream path.
- Install the latest version of liquidsoap (use brew, apt-get etc.)
- Ensure the command
liquidsoap
works for you (liquidsoap is successfully installed).
- Start the StreamMachine server in standalone mode (see the StreamMachine README for details). It'll probably be something like:
./streammachine-cmd --config ./config/standalone.json
- We are going to support multiple mp3 files, by creating a playlist.
a. Note the path of a
playlist.m3u
which has paths to all your mp3 files b. Create your own playlist with
find /path/to/mp3/folder -name "*.mp3" > ~/playlist.m3u
- The final step, tell liquidsoap to hit the right endpoint, authenticate and start playing your playlist
- The command you're looking for is
liquidsoap 'output.icecast(%mp3, host="localhost", port=8002, password="password", mount="test", mksafe(playlist("playlist.m3u")))'
Your stream should now be audible at the configured port/stream path.