86.3 TV Recording

Lets record some TV to an mpeg file. First, get the receiver running on the station you want:

$ tzap -r "SBS"

Then capture the output from the device directly to a file!

$ cat /dev/dvb/adapter0/dvr0 >| sbs.ts

A useful and simple program for the command line to record TV programs was written by Greg Lehey and is available from http://www.lemis.com/grog/programs/record/record.tar.gz.

Obtain this and extract to a folder:

$ wget http://www.lemis.com/grog/programs/record/record.tar.gz
$ cd record

I had to change a couple of things in record.c to get it to work for me.

First, tzap is located as /usr/bin/tzap rather than /usr/local/bin/tzap. Replace

char tzap [PATHMAX] = "/usr/local/bin/tzap"

with

char tzap [PATHMAX] = "/usr/bin/tzap"

The list of TV stations needs to be changed to suit yourself. The author lives in Adelaide, South Australia, so he’s hardwired his stations for his location. Look for the string dvbchannels in record.c. The format is straightforward. Change the first three strings in each row to reflect the stations available in your area.

Next, the version of tzap from dvb-utils does not have a -S (silent) option, so simply remove that line from record.c:

          "-S",    /* be silent */

Then compile the program:

$ make

And install either for your system (into /usr/local/bin) or for yourself (into ~/bin):

$ sudo cp -p record /usr/local/bin/
$ cp record ~/bin/

Now we are ready to record. Here’s some examples:

$ record abc news.ts -s 19:00 -e 19:30 # Start at 7pm End at 7:30pm
$ record abc late.ts -s 22:35 -t 00:30 # Start at 10:35pm for 30 minutes
$ record abc now.ts -t 0:1             # Record now for 1 minute


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0