MythStream Installation
This text covers the installation
of MythStream v0.18_x
For installation of older versions see
the INSTALL file in the source tarball.
1. Runtime requirements
MPlayer
MythStream delegates stream play to MPlayer. Use a recent MPlayer version, and make sure it has the codecs for the streams you want to play. If experiencing problems, start the stream with mplayer from the command line, or use the MythStream dump window (press "D").
- Display of icecast and shoutcast
meta data (song title/artist) requires mplayer version >=
v1.0pre8.
- Playing Flash video (Youtube, etc.) directly requires mplayer > 19 aug 2007. Older MPlayer versions can play flash video, but only after downloading them to the download folder.
- Check the .mplayer/config file for the "really-quiet"-option and remove it if present. It breaks video play in MythStream.
PERL XML modules
Install the perl
modules XML::Simple,
XML::DOM, XML::XQL. Use the package manager of your
distribution to get the perl modules (like apt-get
install libxml-simple-perl libxml-dom-perl libxml-xql-perl
for debian) OR do
shell>
perl -MCPAN -e shell
cpan>
install XML::Simple
...
Note1: If you use parsers not included in the tarball you might need additional PERL modules. Check the parser documentation or run mythfrontend from the commandline to view PERL errors dumped to stdout.
Note2: It is possible to use MythStream with binary parsers. See the README in the alt_parsers directory for more information.
ESpeak synthesizer
Install the Speech synthesizer espeak if you want feedback during
stream browsing. This way you can start a stream without turning on
your TV. Support is pre-alpha. It runs fine on my system, but during
tests on a (ALSA) system espeak was put to nanosleep forever (or until
I killed it by pressing "END" in MythStream). To test: run espeak
"[long line of text]" from two consoles at the same time and see if it
hangs.
2. Upgrading
2.1 Custom player and GUI settings
If you changed player.xml or one of the stream-ui.xml files, copy them elsewhere before installing mythstream and run diff.
2.2 Parser upgrade
When the upgraded MythStream plugin loads for the first time:
- new parsers are added to ~/.mythtv/mythstream/parsers;
- existing parsers are OVERWRITTEN with the tarball versions
- the file ~/.mythtv/mythstream/parserupdate<version>_done that
prevents mythstream from updating parsers on next runs is created, so you can freely modify until the next upgrade.
2.3 Demo stream storage: new features demo
To load another stream storage, first press 0. Then press the storage index number:
- 8: online demo storage
- 9: demo storage included in the tarball
- 0: default storage in the MythTV database (table "stream")
The
demo stream storage contains example stream items. The stream items in
the "Interaction"
folder use muti-stage parsers to query sites like
worldwidemediaproject.com, shoutcast.com and uitzendinggemist.nl. The
"Video" folder contains stream items pointing to DailyMotion and
Youtube video feeds. The "playlist demo" stream items in this folder can be used to
create playlists: mark a video (key
"M") to include it in the playlist and start the top item. Not every
parser is used in the demo database, check the
parser directory for more.
3. Compilation and installation
Requirements
check the PREFIX setting in settings.pro. If mythtv is installed in /usr/share set PREFIX to /usr, for usr/local/share PREFIX should be set to /usr/local.
Make sure you have Qt and X development packages. Check for qt and x11 development packages. On Debian Sarge: libqt3-mt-dev, libqt3-headers, libfreetype6-dev, libfontconfig1, libx11-dev (see MythTV docs).
In addition, you'll need fftw2 (not fftw3) packages. On most distributions installing fftw development and fftw2 devel packages will do. On Suse you will have to compile fftw yourself because Suse provides double precision fftw (dfftw) packages. You can download the fftw source from http://www.fftw.org/download.html.
MythStream uses MythTV libraries. If you have a binary MythTV install, download the mythtv development package (Debian: libmyth-[version]-dev). When not available, download the MythTV source from www.mythtv.org, and make a symlink from the mythstream subdirectory:
cd
mythstream
ln
-s [path to mythtv source]/libs/lib* .
If you didn't compile Mythtv first, you may have to set QTDIR. QTDIR will be something like /usr/lib/qt-3.1 or /usr/lib/qt3,depending on your distribution. Check QTDIR on command line with:
echo $QTDIR
Configure QTDIR
in $HOME/.bash_profile
or set it on command line with QTDIR=/usr/lib/qt3;
export QTDIR
If QTDIR
is not set properly, make will say it's not able to make
....mkspecs/default/qmake.conf
Note: if you set QTDIR after running qmake you have to remove Makefile and mythstream/Makefile before running qmake again.
Installation
type qmake mythstream.pro in the main directory to create the Makefile.
type make in the main directory to begin compiling
type make install
- libmythstream.so will go into /usr/[local/]lib/mythtv/plugins
- data files will be put into the /usr/[local/]share/mythtv/mythstream directory
- image files and ui file go to /usr/[local/]share/mythtv/themes/default[-wide]
4. MythTV menu and themes
Since MythTV v0.20, MythStream menu entries are included in
MythTV's menu xml files.
Note: MythTV 0.20 users must correct a typo in /usr/share/mythtv/library.xml: mythtream should read mythstream.
Some themes still need manual editing
to define the STREAM button in the theme's theme.xml file. This entry
provides the icon in the menu entries. Examples:
In
themes/blue/theme.xml,
<buttondef
name="STREAM">
<image>stream.png</image>
<offset>60,30</offset>
</buttondef>
In
themes/MythCenter[-wide]/theme.xml,
<buttondef
name="STREAM">
<image>ui/button_off.png</image>
<watermarkimage>watermark/stream.png</watermarkimage>
<offset>0,0</offset>
</buttondef>
5. Optional configuration
5.1 Video scaling
The file player.xml holds mplayer command line parameters. If you
have a proper display driver installed, you might want to remove this
(enables software
scaling):
<item>
<name>-zoom</name>
<value></value>
</item>
5.1 Changing the default download directory
When a parser (podcast, dailymotion/feed or a custom parser) adds a
handler field with value STREAM_DL or FUZZY_DL to a stream item, the stream item
(pointing to a media file, not a stream) will be downloaded before play. This file is
stored in the $HOME/.mythtv/mythstream/downloads directory, and a reference to the download is stored in the active stream storage.
By symlinking and (nfs) mounting this download path to a common file storage the downloads can be shared between users and frontends.
A) To
store the downloaded files in the local directory /var/downloads:
assign all users to a common group (e.g. group users)
create a "downloads"-directory and setgid to group users:
cd
/var
mkdir downloads
chgrp -R users downloads
chmod -R 2775 downloads
symlink the new directory as SUBPATH/.mythtv/mythstream/downloads
cd $HOME/.mythtv/mythstream
cp -dpR downloads/* /whatever/path/to/whatever/directory/
ln -s /whatever/path/to/whatever/directory downloads
ln -s /var/downloads .
B) To NFS mount a shared download directory on a remote machine (media):
- on the remote machine add the share to /etc/exports:
/var/downloads desktoppc(rw,no_root_squash)
- on the client machine (desktoppc), mount the share in /etc/fstab:
media:/var/downloads /home/me/.mythtv/mythstream/downloads nfs rw,rsize=4096,wsize=4096,hard,intr,async,nodev 0 0
Make sure the NFS server runs, MythStream will lockup when the server is unavailable.
Short notes about the download process:
- upon selection of a item with STREAM_DL or FUZZY_DL handler, wget will download the uri to the download dir.
- the downloading file will be
renamed as <filename>_temp, a reference to the download is added to the special "download" folder
- if a downloading stream item is selected again, the partially downloaded file will play
- the process that started wget is aware of the running download
- when the download finishes the file will be renamed as <filename>
- if mythstream is exited the download continues, but the filename (and the reference to it) is not renamed
- other mythstream processes will regard the <filename>_temp as a failed download and will start a new download upon selection. What happens next is specified in the wget documentation (I guess).
- If a stream item in the download folder is deleted, the file it references is deleted too
- If a stream item is moved from the download folder and then deleted, the downloaded file is not removed.
6. Troubleshooting
6.1 No MythStream menu entry.
The MythStream menu entry
can be found behind the "Media Library" menu entry in
mythfrontend. If it doesn't appear:
- check for mythstream entries in library.xml and media_settings.xml (in /usr/share/mythtv)
- check for library.xml or media_settings.xml in your ~/.mythtv/ directory, remove them.
- start mythfrontend from commandline and check for a "failed to load" message for mythstream. If mythstream failed to load, it might be compiled to the wrong (old) mythtv headers.
- check if the file libmythstream.so resides in the same directory as the other plugins. Move libmythstream.so if needed.
6.2 No stream items
If no stream items are displayed
after first install and first run, restart the plugin after deleting
the streams table in the mythconverg database:
shell>
mysql mythconverg -u root
mysql>
drop table streams;
The next time mythstream is started,
the file /usr/share/mythtv/mythstream/streams.res
is loaded into the database.
6.3 RTSP streams won't
play, Windows Media streams won't play
If you
can't play a stream check if MPlayer is complaining about missing
codecs in /usr/local/lib/win32 or other paths. Review the mplayer
output in the dump window (press D), or take the stream url and run
mplayer from the command line.
If MPlayer mentiones the path
of the missing codecs, just create that path and copy the proper
codecs to it. Download them
from:
http://www.mplayerhq.hu/DOCS/HTML/en/codecs.html
6.4 No
song title visible while playing Shoutcast streams, cannot play Flashvideo directly
Check
if your mplayer version is recent enough:
- display of icecast and shoutcast meta data (song title/artist) requires mplayer version >= v1.0pre8
- playing Flash video (Youtube, etc.) directly requires mplayer > 19 aug 2007
Check your .mplayer/config file, and remove the option really-quiet=yes