Recording a full DVB transport stream on Linux with dvbsnoop

Most cheap USB DVB dongles (both terrestrial DVB-T and satellite DVB-S) pass the whole transport stream to the host computer for pid filtering in software.

This means we can record a whole transport stream to disc for analysis, manipulation and (with a suitable hardware modulator) play it back over an RF feed to a TV or STB.

Googling how to record a whole transport stream on Linux gave a few different options, none of which worked for me. But in the end I discovered that my favourite “DVB swiss army knife” – dvbsnoop – can actually do the job itself.

Prerequisites

You will need to have already tuned with dvbv5-zap (or similar), and that in turn requires you to have run a channel scan with dvbv5-scan. The following commands work for me for tuning to the DVB-T PSB1 mux in the North-West of the UK.

dvbv5-scan /usr/local/share/dvbv5/dvb-t/uk-WinterHill -o scan_WinterHill.txt
dvbv5-zap -c scan_WinterHill.txt -I DVBV5 "BBC ONE N West" -r

Recording

Once tuned, making a recording is a simple as this:

dvbsnoop -s ts -tsraw -b > psb1.ts

Playing back

The standard hardware and software for playing back transport stream files is produced by Dektec. An example command for playing back PSB1 North-West on Linux is:

DtPlay psb1.ts -r 24100000 -mt DVBT -mf 706 -mc 2/3 -mG 1/32

For DVB-T the parameters are straightforward and generally follow directly from those in the scan file.

For DVB-S the frequency has to be calculated since the LNB down-shifts frequencies for the RF cable as well as selecting the appropriate polarisation. For example, ARD Das Erste SD is currently broadcast from Astra 19.2 at 11836Mhz, however on the RF cable it has been down-shifted by 10600 so needs playing back at 1236Mhz:

DtPlay 11836.ts -r 38000000 -mt DVBS -mf 1236 -mc 3/4

In future post(s) I will hopefully look at analysing and manipulating transport stream files recorded in this way.