April 2024 - This site, and Kamaelia are being updated. There is significant work needed, and PRs are welcome.

Project Task Page: DVBTools

Status: Stasis - No other tasks currently requiring further development of these components
Current Developers: Matt
Current "inflight" dev location:

  • /Code/Python/Kamaelia/Kamaelia/Devices/DVB/
  • /Code/Python/Kamaelia/Kamaelia/Support/DVB/

Start Date: 06 May 2006
Major Milestone date:

  • 09 June 2006 : Code to enable Macro demonstrator complete.

Expected End Date: n/a
End Date: ??
Date this page last updated: 28th November 2006
Estimated effort so far: ~ 50 days (estimate)


Components and example code and tools for receiving Digital Video Broadcasting (DVB) transmissions and parsing and handling the MPEG transport stream (TS) contained in it. Particularly with a mind to the creation of television timeshifting tools.

Using these components it should be relatively simple to instantiate Kamaelia systems capable of using a PC based DVB tuner device to receive an off-air broadcast in real time; extracting audio and video or additional meta data such as "now and next" or "electronic programme guide" (EPG) from the stream.

Simple examples or tools will demonstrate and explain the ways these components can be used to achieve tasks such as recording programmes.



Task Sponsor: TL (BBC internal)
Task Owner: Michael (MPS), Matt (MH)


Interested third parties:


MUST be able to operate in real time

MUST be able to tune and receive transport stream from a terrestrial (receive through aerial) DVB PCI or USB tuner.

MUST support Linux

MUST be able to extract transport stream packets with specific packet IDs (PIDs)

MUST be able to extract Event Information Table (EIT) data containing "now & next" information

WOULD LIKE to be able to extract additional meta data, making it possible to:

WOULD LIKE to support Mac, Windows

Relevant Influencing factors:

"python-dvb3" bindings (to Linux DVB API) donated by MB & PC

Relevant standards documentation: (all are publicly available at no charge to the best of my knowledge -- Matt)



Code in /Code/Python/Kamaelia/Kamaelia/Device/DVB/:

Small example code fragments demonstrating functionality provided by components

Example 'tools' demonstrating applications (eg. recording a channel or programme)

Tutorial webpages


First iteration code (for Kamaelia Macro initial demonstrator):

Example tools:

Components for controlling tuner device and demultiplexing:

Components for parsing stream metadata:

Second iteration code (post Macro):

Example tools:



Components for controlling tuner device and demultiplexing:

Compoents for parsing stream metadata:

Support code (CRC checks & parsing data formats/structures)

Experimental code for making it easier to create and access CAT registered services:

Realistic possibilities arising as a result of activity on this task

Tasks that directly enable this task (dependencies)

Sub Tasks

For Kamaelia Macro initial demonstrator:

Further work:

Write parsers for remaining metadata table types:

Write prettifiers to make output from table parsers more human readable (for debugging & diagnostic purposes)

Rewrite PSI parser to behave as a 'service' able to dynamically serve table data to multiple table parsers, as requested

Refactor tuner and demultiplexing components to behave as a 'service' able to dynamically serve packets with particular PIDs, as requested

Task Log

Retrospectively generated entries (no guarantees of completeness!)

Live entries


Upon investigating how to handle metadata tables containing information such as audio and video PID values, channel names etc. it turned out that often the packet IDs containing tables are dynamically set - you need to look it up in another table first.

This generated the need to modify the demultiplexing components to be able to change what PIDs they extract, and where they send them to, at runtime. Similarly, Matt decided to apply the same logic to the packet->table data conversion (PSI parsing) step.

The EIT parsing code was rewritten (1 day) to match the same code design used for parsing all the other tables, and to add the ability to extract the full 7 day programme guide data.