MythStreamTV

From MythTV Official Wiki
Revision as of 10:49, 24 September 2007 by Harald (talk | contribs) (Installing Mythstreamtv on Fedora Core 6)

Jump to: navigation, search

MythStreamTV is an 'unofficial' add-on to MythWeb which allows you to stream recordings over a network connection. As opposed to MythTV itself, which does this as a matter of course, MythStreamTV transcodes material on the fly to make it more suitable for slower network connections, possibly over the web.

Prerequisites

Package.png The following software is required:

  • MythTV 0.19 or above (different mythtv versions may require different versions of mythstreamtv - this info is taken from the supplied README file in the mythstreamtv tarball)
  • vlc-0.8.1 or above
  • ffmpeg-0.4.9-pre1 or above

Note: the following options are a minimum for MythStreamTV to work (some binary packages may already have the necessary options enabled)

VideoLan-Client Version 0.8.1

./configure --disable-x11 --disable-xvideo --disable-gtk --disable-sdl --enable-ffmpeg \
            --with-ffmpeg-mp3lame --with-ffmpeg-zlib --enable-mad --enable-libdvbpsi \
            --enable-a52 --disable-dvdplay --enable-dvdnav --enable-vorbis --enable-ogg \
            --enable-theora --enable-mkv --enable-freetype --disable-cddax --disable-vcdx \
            --enable-speex --enable-flac --enable-goom --enable-livedotcom --enable-caca \
            --disable-skins2 --enable-modplug --enable-debug --enable-gpl --enable-mp3lame \
            --enable-pp --with-ffmpeg-tree=/video/extra/ffmpeg-cvs-2004-11-10

ffmpeg -- old version

./configure --disable-x11 --disable-xvideo --disable-gtk --disable-sdl --enable-ffmpeg \
            --with-ffmpeg-mp3lame --with-ffmpeg-faac --with-ffmpeg-zlib --enable-mad \
            --enable-libdvbpsi --enable-a52 --disable-dvdplay --enable-dvdnav \
            --enable-vorbis --enable-ogg --enable-theora --enable-mkv --enable-freetype \
            --disable-cddax --disable-vcdx --enable-speex --enable-flac --enable-goom \
            --enable-livedotcom --enable-caca --disable-skins2 --enable-modplug \
            --enable-debug --enable-gpl --enable-mp3lame --enable-pp

ffmpeg -- latest svn version


./configure --enable-ffmpeg --enable-libmp3lame --enable-libfaac --enable-zlib \
            --enable-liba52 --enable-libvorbis --enable-libogg --enable-libtheora \
            --enable-debug --enable-gpl --enable-pp

Installation

Grab a tarball of MythStreamTV from here (not a direct link - read the text in the table to help decide which version is necessary).

Unpack the tarball with

tar xvf mythstreamtv.tar

(amend as applicable)

Move into the newly created mythstreamtv directory and as root, run

./install.sh

Enter the following information:

  • MythStreamTV Directory (The program directory where MythStreamTV will be stored)
  • MythWeb HTTP Directory (Location of MythWeb files.)
  • MythStreamTV Server Address (IP address or hostname you would like to stream from.)
  • MythStreamTV Server Port (Port number you would like to stream from.)
  • MythStreamTV Server Stream Admin Port (This is the port number VLC http admin runs.)
  • MythStreamTV User:Group? (User and group to be used for MythStreamTV Directory.)
  • Path to where vlc is installed (Location of the vlc binary on your system.)

The next step (with 0.19-fixes MythWeb) is to ensure that includes/init.php (within the mythweb dir.) has the line

'streamtv' => null,

(note the 'tv' part)

underneath the lines containing

'tv' => null,

'video' => null,

'music' => null,

Using MythStreamTV

At the top of MythWeb there should now be a link that says 'Stream Program'.

When the 'Stream Program' link is clicked, MythWeb should show a list of recorded/recording programs. Select the show/shows you would like to see and click the 'Select Recording and Continue' button.

Now select the Codec and Stream Speed to use and click 'Start Live Stream'. In the Log window a message should appear that the VLC session was able to start successfully.

Now click the MMS link. If your mimetype has been properly configured it should launch an MMS viewer ie: Mplayer or Window Media Player. If your mimetype for MMS is broken you may enter the MMS link directly into your MMS player.

The MythStreamTV admin port connects locally and does not need to be opened from an external firewall. MythWeb launches a script that sends the command to the vlc admin port locally and controls the stream.

  • If no video is selected, MythStreamTV will kill the current VLC session being streamed. The "Stop Streaming" button can also be used to kill the streaming.

Support

For installation help or bugs please visit the support forum on SourceForge http://sourceforge.net/projects/mythstreamtv/

Troubleshooting

I had some problems getting this working with 0.20 under Ubuntu and it turns out that the it does work, but I had to modify the mythstreamtv.sh file (typically in /usr/share/mythstreamtv).

I changed the area just after

echo "Starting Stream of $1" to

      if [ $PROTOCOL = "mms" ]; then
        /usr/local/bin/vlc -I http --http-host=:8002  --sout-transcode-fps=$FPS --sout-transcode-deinterlace $1 :sout="#transcode{vcodec=$VCODEC,acodec=$ACODEC,vb=$VB,ab=$AB,scale=$SIZE}:std{access=mmsh,mux=ogg,url=:8001}"
      elif [ $PROTOCOL = "http" ]; then
        /usr/local/bin/vlc -I http --http-host=:8002  --sout-transcode-fps=$FPS --sout-transcode-deinterlace $1 :sout="#transcode{vcodec=$VCODEC,acodec=$ACODEC,vb=$VB,ab=$AB,scale=$SIZE}:std{access=http,mux=ogg,url=:8080}"
      fi

Notice the fact that I hard coded the use of the OGG packager, moved a " to after :sout= and removed some http settings.

I also added the mp4v option in the confirm.php file. This file is located in /var/www/mythweb/modules/streamtv/tmpl/default on my system. I added the line

<option <?php if ($videoformat_default==='mp4v') echo 'SELECTED' ?>>mp4v</option>

under video format. NOTE CASE DOES MATTER for the new VLC. You must also change the audio stream option to be lowercase -> mpga, not MPGA.

When these changes are completed, and assuming you have the right libraries, I started the stream via the web interface, then open it in VLC using something like "http://myaddress:8080". If someone knows how to make vlc auto play, please put that info here!!

Installing Mythstreamtv on Fedora Core 6

The MythStreamtv tarball from here are no longer maintained. I tried to use it under Mythtv 0.20.2 but Mythweb has changed a lot so I got errors about missing files when trying to install MythStreamtv with the install.sh script. But the MythDora guys has fixed these problems and made a rpm package accessible from here. Install the rpm package like this:

[root@mythpc mythtv]# rpm -Uhv mythstreamtv-1.3-8.noarch.rpm

or the easy way with yum. Make a textfile called mythdora.repo and make sure the following lines are included in /etc/yum.conf/mythdora.repo:

[mythdora]
name=MythDora 4.0 - $basearch
baseurl=http://dl.atrpms.net/mythdora/4.0/$basearch/os/
enabled=1
gpgcheck=0
[mythdora-updates]
name=MythDora 4.0 Updates - $basearch
baseurl=http://dl.atrpms.net/mythdora/updates/4.0/$basearch/
enabled=1
gpgcheck=0

After installing the mythstreamtv-1.3-8.noarch.rpm package you must edit the Mythstreamtv install.sh script because the path included into the script are Mythdora spesific.

[root@mythpc mythtv]# cd /usr/share/mythstreamtv/
[root@mythpc mythstreamtv]# nano install.sh

In the middle of the script you will find this. Change into the prefered paths:

######### Set our defaults ##########
STREAM_DIR=/usr/share/mythstreamtv
NEW_STREAM_DIR=/storage/mythstreamtv
HTTP_DIR=/var/www/html/mythweb
STREAM_ADDR="hostname.homelinux.org" --> Your ip-adresse or DNS name
# Stream address can be a domain such as "domain.homedns.org" with the quotes
STREAM_PORT=8001
STREAM_ADMIN=8002
USER_GROUP="mythtv:mythtv"
VLC_PATH=`which vlc`
#####################################

After you have done this you must run the script.

[root@mythpc mythstreamtv]# ./install.sh
Setting up MythStreamTV......


----------------------------------------------------------------------
   MythStreamTV Directory         : /storage/mythstreamtv
   MythWeb HTTP Directory         : /var/www/html/mythweb
   MythStreamTV Server Address    : galenos.homelinux.org
   MythStreamTV Server Port       : 8001
   MythStreamTV Stream Admin Port : 8002
   MythStreamTV User:Group        : mythtv:mythtv
   Path to where vlc is installed : /usr/bin/vlc
----------------------------------------------------------------------
Installing MythStreamTV.........
.... Checking MythWeb Compatablity: .... Installing /storage/mythstreamtv/mythstreamtv.sh: Success
.... Installing /storage/mythstreamtv/mythstreamtvactive.sh: Success
.... Installing /storage/mythstreamtv/mythstreamtvctrl.sh: Success
.... Installing /storage/mythstreamtv/mythstreamtvstop.sh: Success
Creating StreamTV Diretory's in MythWEB...
.... Installing /var/www/html/mythweb/modules/streamtv/handler.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/init.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/confirm.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/createfile.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/selectstream.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/default/createfile.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/default/menu.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/default/confirm.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/default/selectstream.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/default/welcome.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/compact/createfile.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/compact/menu.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/compact/confirm.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/compact/selectstream.php: Success
.... Installing /var/www/html/mythweb/modules/streamtv/tmpl/compact/welcome.php: Success
.... Checking MythWeb Installation: Not required, skipping
.... Fixing up file permissions: Done 
Installation Complete!  Good Luck.
[root@mythpc mythstreamtv]#