AllThingsLinux

rants on Linux and stuff… especially stuff.

How to watch streamed TV from dr.dk in openSUSE or Ubuntu

The following post is probably of most interest to Danish readers, but I will keep it in English for the sake of any non-Danish readers who might be interested anyway.

First off, a little background information. DR (Danmarks Radio) is a state owned national TV station that, among other things makes streams of its news broadcasts as well as other programming available to residents in Denmark. However, somewhat disappointing for a state owned company they have chosen to buy into the Microsoft regime, using the wmv format instead of open standards. But despair not – we still get to watch our dearly paid-for TV over the internet in Linux – it merely requires a little preparation.

1. Make sure you install the relevant codecs from the repositories, such as w32codec-all (openSUSE), or ubuntu-restricted-extras (Ubuntu, Kubuntu and the like). If after completing every step you still can’t watch any tv from TV, double check that you’ve got all codec packs.

2. Install the VLC media player – simply go to your package manager, search for vlc, and install it.

3. Install the MediaPlayerConnectivity addon for Mozilla Firefox. You can use Firefox’ own built-in addon search or just use the link.

4. Display the Run dialog box by pressing Alt+F2, or whatever you have it set to, and run the following command (for any KDE system): kdesu kwrite /usr/bin/drplayer.pl (or use a terminal – whichever you prefer)

This will use kdesu to start an adminstrator session of Kwrite, creating a file named drplayer.pl in your /usr/bin folder.

5. Insert into that following italic lines of text:

#!/usr/bin/perl

my $logfil = "/tmp/drlog.log";

$_ = $ARGV[0];
s/mms:/http:/;
s/C3%A6/e6/;
s/C3%B8/f8/;
s/C3%A5/e5/;
s/c3%a6/e6/;
s/c3%b8/f8/;
s/c3%a5/e5/;

open (LOGFIL, ">>$logfil");
print LOGFIL "$_\n";
close LOGFIL;
system "/usr/bin/vlc $_";

Note: As you can see on the last line, this version of the script uses vlc, but you should be able to substitute that for any video player with a graphical front-end.
If your’re satisfied with VLC for now, simply save the file and close it.
What you just did was create a Perl script file, that I found here, to translate the non-ASCII characters from the online streams of DR.

6. We are going to have the MediaPlayerConnectivity addon use our little script for wmv streams, so press Alt+F2 again to display the Run dialog box, and enter: kdesu chmod a+x /usr/bin/drplayer.pl
This will use kdesu to run chmod with administrator rights, and specifies that all have execute permission for the file /usr/bin/drplayer.pl

7. Start Firefox and and let the MediaPlayerConnectivity addon do its auto-configuring when it pops up. After that, configure the addon to use our script by bringing up the MediaPlayerConnectivity configuration in Firefox:
Tools >> MediaPlayerConnectivity >> Configure… >> Audio/Video Players. Now, in the command line box for Windows Media, simply replace whatever is there with /usr/bin/drplayer.pl
Then press OK, and you’re done!

…Now go watch some decent programmes on gardening, Thai cooking, or pre-19th century German philosophy.

August 13, 2008 - Posted by | howto | , , , , ,

No comments yet.

Leave a comment