Streaming MythTV Recordings Over the Internet


MythTV records DVB programmes into very large MPEG2 files. These can be streamed around the house over a wireless-g connection without any problems. The best way to do this is to install a MythTV frontend on a laptop. However, what if you wanted to view them on a smartphone or over the Internet?

Here we'll look into some of the options available.

MythTV Go for Android

We introduced this new android app on our android page. Here, we'll look into how to access the streams over the internet.

The method we will use is to establish a secure connection from your android phone, through your router, into your backend server. We will use SSH to do this, which will allow us to forward port 6544, which is the MythTV backend services port. This will give applications on your android device direct access to MythTV features and recordings. The following tutorial will guide you through forwarding port 6544 via SSH:

Once the ports are forwarded, that's the hard bit out of the way. All you need to do is run up MythTV Go and add a new backend server: Preferences->Backends->Add:

Backend Name: remote
IP Address:   localhost
Port:         6544

Once that is done you should be able to use the app to watch recordings from anywhere as if you were on the local network. The only restriction is bandwidth. MythTV Go prompts you to select the desired transcode quality: Low, Medium or High, so just try them to see which works nest for you.


The VideoLAN Client (VLC) is the answer to all your video streaming needs. It can do all of the above and more, even transcoding the MPEG2 files down to MPEG1 in real time and transmitting them over a HTTP connection to anywhere in the world.

Additionally, this can all be done with the version of VLC that comes as standard with Ubuntu Feisty 7.04!

Just add the universe repository and install the VLC package onto your MythTV backend server:

sudo apt-get update
sudo apt-get install vlc

Client Software

The best way to view the stream is to install VLC on your client machine. There are packages for Windows, Mac, PocketPC, BeOs, etc. available here.

Accessing MythTV Recordings

By default, MythTV recordings are saved into /var/lib/mythtv. However, they're created with cryptic names such as 1009_20051031153000_20051031161500.nuv. A great way to access these files is with a script called mythlink. This comes as part of the MythTV source code and creates a symbolic link to each file with a readable name.

Streaming DVB Recordings Over a LAN

Now for the fun bit. To stream an MPEG2 file in full quality, run mythlink to generate a links to your recorded files. Then kick off a stream using:

vlc 03041759_The_Simpsons.nuv --sout '#std{access=http,mux=ts,url=:8081}'

To view the stream on your client machine, run the following command. Don't forget to replace the name loki with the hostname of your server.

vlc http://loki:8081

Streaming Over the Internet

In this example, we'll be streaming over TCP port 8081. You can specify any port you wish, but remember that whichever port you choose must be open on your firewall.

ADSL uplink speeds are pretty awful (but getting better all the time), so to stream over the Internet we'll need to shrink the MPEG2 file as small as possible. We could do this prior to streaming using a package such as ffmpeg. However, a much simpler solution is to get VLC to transcode the stream in real time. There are lots of parameters to play with, but the following works for me. It transcodes the stream into a tiny MPEG1 format, 0.25% of the original size. Not particularly watchable, but the principle is there! Run the following on the server:

SSH to your server and run the following:

vlc 03041759_The_Simpsons.nuv \
    --sout '#transcode{vcodec=mp1v,vb=64,scale=0.25,acodec=mpga,ab=64}:std{access=http,mux=ts,url=:8081}'

Run the client on the remote machine as before:

vlc http://loki:8081

Controlling the Stream

So, you can now stream over the internet, but is there an easier way to choose which videos to watch? VLC comes with a number of interfaces which allow you to choose and control the streams. One of the best ways is the HTTP interface. VLC has a small web server built in, which you can control remotely using any browser. The following command starts a VLC server with a HTTP interface. Any files chosen from the browser will be transcoded and streamed as usual:

vlc -I http --http-host :8080 \
    --sout '#transcode{vcodec=mp1v,vb=64,scale=0.25,acodec=mpga,ab=64}:std{access=http,mux=ts,url=:8081}'

On the client machine, point your browser to http://loki:8080. You should see the VLC control screen. From here, you can access your server's filesystem and choose which videos or music to stream.

Then, simply connect to the stream using VLC as above.


The above method of using VLC for streaming and controlling it using the http interface is the underlying mechanism for MythStreamTV. This is an addon for MythWeb. However, it relies on very specific codecs which the standard pre-compiled versions of VLC don't support. Also, using VLC directly can be more flexible.

Alternative Method - Using Flash Video

An alternative method is to stream your recordings using flash video. All you need is a flash-capable browser on your client side. Unfortunately, you can't transcode as you stream, unlike VLC, so you will have to do this beforehand using ffmpeg. The method is detailed on the MythTV Wiki: Stream mythtv recordings from mythweb using flash video.