1. Description

This TV software is designed to be displayed in full-screen on a television, projector, or similar display device. The software manages and renders television broadcasts captured via Linux DVB compatible digital tuners, and is able to process simultaneous program streams (channels) within any transport stream (mux), making an efficient use of the available digital TV tuners.

An electronic program guide is provided for storing and viewing programs that are either currently playing or in the buffer. At the moment, the program guide parses its data directly from (Finnish only), detects your favourite and must-see programs, and automatically stores them accordingly for later viewing.

The graphics engine doesn't rely on any external libraries, and implements everything from low-level YUV-space rendering to higher level animations and video stream controlling. Visual appearance is designed with simplicity in mind, particularly avoiding any sudden appearance or disappearance of visual elements, resulting in (overly) smooth transitions between states and menus. A remote control is used for user input.

2. Feature list

2.1. Graphics engine

2.2. Channel/program management

3. Demonstration

3.1. Video

thumbnail A video capture, 1min 44secs in length, PAL (720x576) resolution. The video has unfortunate glitches in it; my video capture hardware lacked the hard drive throughput to handle the uncompressed output video stream. Normally the output isn't stored, it is only played on the screen. The video demonstrates most of the current features. Only one DVB tuner card is used. (Note: The program is rewound during the viewing of 'Reba' in the end of the capture.)

3.2. Screen captures


The electronic program guide view. The channel previews are live. The color coding is as follows:

Light green Program partially in buffer
Green Program fully in buffer
Cyan Stored program (will not get flushed out with the buffer)
Orange A program tagged as a favourite
Red A program tagged as a "must-see" (top)
Yellow The cursor

A program menu is shown as well, for a program currently broadcasting, and for a program yet to be broadcast.

The program viewer. The green bar indicates the buffer. The movie and the commercials are broadcasted with different aspect ratios. The transitions between aspect ratios are automatic (and smoothed using a sin()-slider).
The main menu. You can either start watching live TV or play back stored programs.
thumbnail The file player view, used to play stored programs.
thumbnail The EPG view during a mode transition. The video capture is a better demonstration of this.

4. Design/implementation details and notes

The program is logically separated into two parts: the graphics engine and the control unit.

4.1. Graphics

The graphics engine is responsible for everything visual on the screen. The program uses its own software rendering engine (written in C++) for all graphics. The construct is easily portable to OpenGL as well, and I have an earlier OpenGL version of the engine in use in another project; I will port this to OpenGL as well, if I see the need for it.

At the moment the graphics output is raw uncompressed YUV4MPEG video stream, directly playable with mplayer. The rationale behind such a decision is that the software can be played on any type of display device that is able to output video with mplayer. Not every display device used for watching TV is able to act as a X11 display for example, but almost every configuration can be used with mplayer: console framebuffer devices, decoder cards, etc, including X11 displays. Personally, I use this software with a DXR3 MPEG2 decoder card, which can't be used as a X11 or OpenGL backend.

4.2. Control unit

The control unit launches a modified dvbstream utility as a thread within the software to extract program streams after tuning in on a program multiplex (mux). With the modifications, dvbstream is able to extract multiple concurrent program streams and supply the data internally for the application for further processing. Multiple dvbstream instances, for different DVB tuners, can be launched allowing a simultaneous activation of channels from different muxes.

Any code being in contact with the dvbstream unit is written in C. Most of the control unit is written in C++, and the electronic program guide parser is written in Perl. All software code (graphics engine included) is basically Unix compliant, so it could be ported to any other Unix, whose DVB devices can be accessed with dvbstream. Linux input event interface (evdev) is used for remote controlling, but remote control code is well separated, and is easily replaceable with an alternative interface.

4.3. Performance

The program is multi-threaded (using posix threads) and uses separate processes for program stream decoding, allowing an efficient usage of about 5 processors. The program can easily run 3 simultaneous channels on a PAL resolution screen with a 2.53 GHz Celeron-D. HD (1280x720) resolution is usable at 20 fps with the EPG view on, and at the full 25 fps while playing a program. Any modern CPU (especially a dual-core) should be able to run the program at full speed with full-HD resolutions, and have plenty of reserve CPU time for possible encoding of stored programs, etc.

5. Source code

The software will be released under another project, later.