Using streaming media in mvpmc

M. Vallevand

2006-04-12, v0.00.02

1. Introduction

2. M3U Playlist file format

3. Configuring Streams

4. Browser Configuration

5. Stream Display


1. Introduction

To access Internet Radio in mvpmc use the Filebrowser option and select a previously saved m3u playlist file. mvpmc internally supports mp3 and ogg vorbis streams and can with the assistance of vlc and mplayer output Windows Media, Real Player and aacPlus streams.

The simplest configuration when the mvpmc is used primarily for Internet audio would be to configure the startup folder to be /usr/playlist and have filebrowser as the startup option. From the command line this is --startup filebrowser:file:/usr/playlist or (without quotes) Startup Option "File Browser" Startup Folder "/usr/playlist" via browser configuration

2. M3U Playlist file format

The M3U playlist format is a very open standard for multimedia format. mvpmc supports two format for the m3u playlist standard and extended. The standard format is a text file with one or more URLs. Audio internet streams can begin with http:// rstp:// mms://or mmsh://

Sample m3u streaming files

http://xalt.ic.llnwd.net/stream/xalt_woxy_hi_will_be_missed
http://www.dirty.org/high/listen.pls
http://64.71.150.29:12942/
http://radio.globalpopconspiracy.com:8000/gpc/hi.mp3
http://www.hipster.org:8010/listen.pls
http://sc1.liquidviewer.com:9010/listen.pls

The extended m3u adds a readable text description for selection in mvpmc Sample extended format
#EXTM3U
#EXTINF:-1,Classical: SKY.FM
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=4857&file=filename.pls
#EXTINF:-1,Metal: The Edge Rocks!!
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=2184&file=filename.pls
#EXTINF:-1,Metal: CroniX Aggression
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=8524&file=filename.pls
See http://gonze.com/playlists/playlist-format-survey.html#M3U for examples Anyone using the hauppauge software for internet radio should be able to copy their saved .mvp radio playlists as .m3u files and play them. WMA is supported via vlc.

3. Configuring Streams

Natively, mvpmc supports http streaming of mp3 and ogg vorbis media file. Additionaly using external programs running on a host machne it is possible to stream Windows Media, Real Audio, and aacPlus audio over http, rtsp and mms protocols.

3.1 Shoutcast Streams

To make playing shoutcast streams easier several playlists genres can be selected through the browser interface. The first time a genre is selected a special URL will be added as playlist item 1. When this URL is "played" for the first time mvpmc will download the 20 mp3 streams for this genre. Note that the shoutcast link can change regularly and it is best to update the m3u playlist with the link from the host site whenever possible

Supported genres

60s               70s               80s               90s               2000s
alternative       ambient           blues             celtic            chill             
classical         college           comedy            country           dance             
disco             drum & bass       electronic        folk              funk              
goth              hiphop            house             indie             industrial        
jazz              metal             oldies            podcasts          pop               
punk              r & b             random            rap               reggae            
rock              soul              soundtracks       techno            top40             
trance            world             

3.2 live365

live365 streams need a username & password. These can be added in the browser interface or from an environment variable which needs to be set up before mvpmc runs. The format is

export LIVE365DATA='###&password=****' 

where ### = username and ****= password.

Without a browser interface the easiest way to do this is via the dongle.config file. Note I only have a free live365 account and I have no idea if this logic works for subscribers.

3.3 Podcasts

Instead of creating a link to the dynamic mp3 stream, in the playlist create a link to the static source xml file ie

http://www.woxy.com/podcast_mrm.xml
mvpmc will then download the xml file and stream the first mp3 file which is typically the current podcast.

3.4 Supplementary Audio Formats

Two excellent programs, vlc and mplayer are readily available to assist mvpmc in playing audio 
streams not currently supported natively.  With vlc alone, mvpmc can play streaming Microsoft Media 
files and with the addition of mplayer support is added for Real Audio and aacPlus using many 
streaming protocols.

VLC Configuration

To enable vlc support the IP address for vlc must be either added on the mvpmc command line 
with the option --vlc xxx.xxx.xxx.xxx or install it via browser configuration.  This will 
permit playing of Windows Media found in URLs starting with http://, mms:// and mmsh://  
The mms URLs can be directly added to an m3u playlist if desired or necessary.  mvpmc also 
support access via a Windows Media playlist typically .ASX files.

The server-side configuration of vlc requires enabling the telnet interface on the default 
vlc listening port of 4212.  This can be done via the vlc GUI or on the command line as follows  

vlc -I Telnet

vlc will stream the requested audio stream back to the mvpmc in http on port 5212, Although, 
connection is automatic on the requesting mediamvp, others can direclty to this vlc server 
for shared access to the same source.

Mplayer Configuration

Playing Real Audio and aacPlus streams require access to mplayer.  Access to mplayer is via a
small daemon program, mpslave, which runs on the vlc host computer.  This program
loads mplayer, accepts commands from the mvpmc on port 4213 and passes these in slave mode
to mplayer.  mplayer then creates a temporary file /tmp/mvpmcdump.wav which vlc will then 
stream back to the mvpmc.  Although this sounds complicated it all completely automated in
mvpmc.

To enable this function download the file "mpslave" and place it in the folder with the mplayer 
executable.  After this you can run it.

Assumptions

1. vlc and mplayer are running on the same computer.
2. vlc and mplayer are either running from the same drive in windows and the folder 
   \tmp exists on this drive or in other environments vlc and mplayer can both access 
   folder /tmp
3. Only one mvpmc is controlling access to mvpmc.
4. mplayer and mpslave are in the same folder or mplayer is in the path.
5. aacPlus streams support is currently only available in nightly builds of mplayer.  

3.5 Supplementary Video Formats

When VLC is configured properly it also gives mvpmc the potential of playing 
other local video files using the file browser.  All video files are currently transcoded into 
2 MB mpeg-2 format, 192 mpeg audio, and no sub-titles and this cannot be modified.

Currenty mvpmc can play video stored with the Divx format, others can be added as they
are tested.  Divx file must have a .divx extension to be properly identified.

To methods of playing video files exist.

1.  Create a playlist item with the filename of the video file as it would be accessed by
VLC.  Typically the http:// identifier is not needed when the file is being accessed locally.

or 

2.  If the mvpmc and VLC see exactly the file and pathname, video files can be
directly accessed.  Note that VLC on Windows can use unix style path names and could play
 /video/sample.divx.   If drive letters are required only option 1 is available.

4. Browser Configuration

Browser access to the mvpmc is the via http://xxx.xxx.xxx.xxx where the xxx's is the
address of your mvpmc (the address is shown in the about window)

To enable the browser interface add the following to the mvpmc command line
--web-port ##
where ## is the port you wish to mvpmc to listen on.  

If a port other then 80 is selected add the port to the address ie. http://xxx.xxx.xxx.xxx:6000

Loading the mvpmc dongle as a replacement for the Hauppauge dongle.bin the browser interface is
enabled on port 80.

Several option exist in the browser configuration.
- modifications of all setting not with mvpmc itself
- m3u playlist editing.
- headless mvpmc control (play a stream from the browser interface, stop mvpmc, restart mvpmc with
  out rebooting).
- direct creation of cifs shares without telnet

5. Stream Display Information Options

1. An mp3 input stream is read into mclient's 128k buffer. For internet radio on the status bar there is an indication of how full this buffer is, it can be "filled" a bit with the pause key. The cpu utilization although low, is lowest with good streams that tend to fill the buffer. For fixed content length streams the stream is still buffered, but the bar shows % of content read. Given this buffer and the hardware buffer, audio will continue after 100% read.

2. mp3 shoutcast title will be displayed in the file browser menu and in a larger "screensaver mode" display.

3. ogg vorbis artist and title information is display in the file browser menu when available.

4. If browser configuration is available to special options are availble. Connect to your mvpmc with the browser the following URLs:

http://xxx.xxx.xxx.xxx/connect.log shows a log of information mvpmc uses to connect to streaming media. This can be helpful in determing the actual URL for audio streams.

http://xxx.xxx.xxx.xxx/played.log shows a log shoutcast metadata information when available for the current/last shoutcast audio stream listened to. A port will need to be specified if a port other then 80 is used