If you have made the move to digital TV you might be familiar with the “red button” service, the idea of pressing the red button on your remote control to take you into digital interactive services. These are usually the modern equivalent of teletext from the old analogue days but can be a little more adventurous with services such as news or sport “multiscreen” services where you can choose a video you want to watch. Various technologies make these services possible, they all include ways to display information sent over the airwaves and also provide ways to show information provided over the Internet (if available on the set top box you are using). If you are using Ubuntu (or any Linux machine) you can get hold of software that will allow you to experiment with an open standard in this area called MHEG-5.
MHEG-5 is used on the Freeview and Freesat digital TV platforms in the UK, and various platforms abroad (Sky use a proprietary platform called OpenTV). It isn't the only open standard targeting interactive digital tv, there is also the Multimedia Home Platform which is used in many countries and uses Java. You can write MHEG-5 programs using a simple text editor. Their structure is a little different to many programming languages are they consist of a number of Scenes that make up an application. The Digital Video Information site contains a code sample showing you how the famous Hello World program would be created using this language at: http://www.digvid.info/mheg5/hello_world.php. You can get full details on the UK profile of the language by visiting the Digital TV group website at: http://www.dtg.org.uk/publications/books_mheg.html, to get hold of the document you have to provide some details, but there seems to be no particular restriction on who can get the document.
All of this isn't much use without something to run the code on. It may not be possible to run the code on an actual device that can understand MHEG content, but it is possible to download some software so we can view it on a Linux machine. Thanks to Wikipedia I found out about the RedButton MHEG Engine project, which provides utilities to download, view and author MHEG content on a local client. Alas this is not in the Ubuntu repositories and is only available as source code (nothing wrong with that of course) so we must compile it ourselves before we can have fun with MHEG. The front page for RedButton suggests that you can just download the source code, extract it and type 'make' but before you do this you will need to prepare your machine so that it can provide everything needed for the compilation process, otherwise you will get lots of errors.
If you don't have this installed already, install the build-essential package (sudo apt-get install build-essential) to provide the compiler and make tool. You now need to get all of the dependencies for the source code (type below as all one line):
sudo apt-get install libfreetype6-dev libavformat-dev libxrender-dev libxft-dev libpng12-dev libasound2-dev
On the Sourceforge download page for RedButton, you will see three entries: redbutton-author ,readbutton-browser and redbutton-download . I didn't compile redbutton-download as I don't have a device capable of grabbing MHEG files from broadcasts attached to my computer. Compile redbutton-browser first following these commands:
tar xvzf redbutton-browser-20070928.tar.gz
cd redbutton-browser
make
You'll get some warnings but the code should compile and you should see a new binary called rb-browser . Next you can download redbutton-author and (making sure you are in the parent directory from rb-browser) compile with these commands:
tar xvzf redbutton-author-20080125.tar.gz
cd redbutton-author-20080125
make
You should get some new binary files including mhegc and mhegd, these are files to turn your text from to and from the smaller ASN.1 format. You can get up and running with the Hello World sample file quickly, the source code is included in redbutton-author. The rb-browser program needs the MHEG file to be in the ASN.1 format in order to understand it, if you are still in the redbutton-author directory you can do this with (note there are two files that need changing):
mhegc -o helloworld/startup helloworld/startup.txt
mhegc -o helloworld/hello.mhg helloworld/hello.mhg.txt
Run it with:
../redbutton-browser-20070928/rb-browser helloworld/
The results are not exactly spectacular, but should show everything working, and all of this should be enough to give you the tools to be able to experiment with MHEG to see what sort of services and ideas might work on a digital interactive TV service equipped with this technology. It is becoming possible to do some quite interesting things with this technology, one blog worth keeping an eye on in this area is the BBC - Press Red Blog which recently carried a post about how it is even possible to program games using MHEG. It is the Internet connectivity though which could be the most interesting aspect of this technology, will our experience of the web be primarily delivered through a browser in a few years time?
*** UPDATE 4th May 2009 ***
If you are trying this in Jaunty, you might have a problem installing the required dev packages. This is due to bug no. 312898. If you get this working on Jaunty, let me know!
Re: The Red Button: Authoring interactive digital TV ...
Hi,
How to do the same in fedora 9 core.I am very new to linux.
Re: The Red Button: Authoring interactive digital TV ...
Hello Liam!
I'm geting this error installing redbutton-browser, do you know how to solve it?
Thx!
MHEGDisplay.o: In function `MHEGDisplay_newMPEGBitmap':
MHEGDisplay.c:(.text+0x623): undefined reference to `sws_getContext'
MHEGDisplay.c:(.text+0x666): undefined reference to `sws_scale'
MHEGDisplay.c:(.text+0x671): undefined reference to `sws_freeContext'
MHEGStreamPlayer.o: In function `decode_thread':
MHEGStreamPlayer.c:(.text+0x1472): undefined reference to `av_free_packet'
videoout_xshm.o: In function `vo_xshm_prepareFrame':
videoout_xshm.c:(.text+0x32e): undefined reference to `sws_freeContext'
videoout_xshm.c:(.text+0x379): undefined reference to `sws_getContext'
videoout_xshm.c:(.text+0x3f4): undefined reference to `sws_scale'
videoout_xshm.o: In function `vo_xshm_fini':
videoout_xshm.c:(.text+0x495): undefined reference to `sws_freeContext'
mpegts.o: In function `mpegts_demux_frame':
mpegts.c:(.text+0xa17): undefined reference to `av_free_packet'
mpegts.c:(.text+0xa99): undefined reference to `av_free_packet'
mpegts.c:(.text+0xac3): undefined reference to `av_free_packet'
mpegts.c:(.text+0xb66): undefined reference to `av_free_packet'
mpegts.c:(.text+0xb71): undefined reference to `av_free_packet'
collect2: ld returned 1 exit status
make: *** [rb-browser] Error 1
Re: The Red Button: Authoring interactive digital TV ...
I needed to install libxaw7-dev libswscale-dev under karmic.