Streaming General Conference from MythTV

Every 6 months, the Church of Jesus Christ of Latter-day Saints broadcasts on television a series of meetings called General Conference.  There are usually 6 meetings, each 2 hours long, each meeting consisting primarily of talks by about 6 people.  On General Conference weekends, members of the Church watch the conference instead of attending local meetings.

I like to use MythTV to record the public sessions from KSL, a local TV station.  That way, I get a pristine, high definition picture that I can review anytime I like.

Two of the meetings are on Saturday.  During the Saturday meetings, I prefer to multitask while listening to conference.  I want my wireless laptop to play the audio and a miniature version of the video.  I finally figured out how to do that.

I started with the directions on  That page describes how to use VideoLAN to stream a video even as it’s being created.  Unfortunately, those directions seem to be out of date, as is the mythlink script the page links to.   So here is my version of the mythlink script (with the database password replaced with ‘fakepw’):


# - Symlinks mythtv files to more readable versions
# by Dale Gass

if [ ! -d /tv/links ]; then mkdir /tv/links; fi
rm -f /tv/links/*

echo "Done RM"
mysql -umythtv -pfakepw mythconverg -B --exec "select chanid,starttime,endtime,title,subtitle from recorded;" >/tmp/mythlink.$$
perl -w -e '
        my $mythpath= "/tv";
        my $altpath= "/tv/links";
        if (!-d $altpath) {
                mkdir $altpath or die "Failed to make directory: $altpath\n";
        while (<>) {
                my ($chanid,$start,$end,$title,$subtitle) = split /\t/;
                $start =~ s/[^0-9]//g;
                $end =~ s/[^0-9]//g;
                $subtitle = "" if(!defined $subtitle);
                my $ofn = "${chanid}_${start}.mpg";
                do { print "Skipping $mythpath/$ofn\n"; next } unless -e "$mythpath/$ofn";
                $start =~ /^(............)/;
                my $nfn = "$1_${title}";
                if ($subtitle) {$nfn="${nfn}__${subtitle}"}
                $nfn =~ s/ /_/g;
                $nfn =~ s/&/+/g;
                $nfn =~ s/[^+0-9a-zA-Z_-]+/_/g;
                $nfn = "${nfn}.mpg";
                print "Creating $nfn\n";
                unlink "$altpath/$nfn" if(-e "$altpath/$nfn");
                symlink "$mythpath/$ofn", "$altpath/$nfn" or die "Failed to create symlink $altpath/$nfn: $!";
' /tmp/mythlink.$$
rm /tmp/mythlink.$$

This handy script generates links to make it easy to find recorded TV programs on the filesystem. After running the script, I started a VLC streaming server like this:

vlc 200904041400_LDS_General_Conference.mpg --sout \

I learned what options are available from the VLC streaming documentation.  The command I used creates a 2 megabit per second streaming server using the MPEG-4 and MP3 codecs, with the video scaled from high definition (1920×1080) to 480×270. Then I launched the client on my laptop:

vlc http://tiger:8081

This worked very well. Both the video and audio were very clean and never stalled.  The MythTV server has an AMD 5200+, which is more than fast enough to simultaneously record the high definition stream to a hard drive, play it back with scaling, transcode down to 480×270, and send the transcoded stream to multiple clients.

Of course, this will all be much easier when MythWeb gains the ability to generate Flash videos.