Skip to content
Alistair Buxton edited this page Jun 23, 2024 · 8 revisions

Teletext Decode

This is a suite of tools for processing recorded teletext signals as well as tools for processing teletext packet streams.

The software has been tested with bt8x8, CX Cards & the DomesDayDuplciator capture hardware (VHS-Decode), but should work with any VBI capture hardware with nearly any appropriate configuration.

Installation Ubuntu & Debian Based Linux Distros

Download & Install Dependencys

Python 3 - sudo apt install python3 & pip - sudo apt install python3-pip

Download the repository via clone

git clone https://github.com/ali1234/vhs-teletext.git

Or via the green code box, local, download zip.

pip3 install -e .[spellcheck,viewer]

For latest versions of Ubuntu like 23.04 the installation is done using

pipx install -e .[spellcheck,viewer]

The decoder can use Nvidia Cuda or OpenCL acceleration to decode the data.

Nvidia Cuda

In order to use CUDA accelarated decoding you need to use the Nvidia proprietary driver.

Open a terminal

Update Packages with sudo apt update

Install the Nvidia Driver with sudo apt install nvidia-driver-525

Install the Nvidia Utilitys sudo apt install nvidia-utils-525

Install CUDA Toolkit sudo apt install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc

Enter into vhs-decode teletext with cd vhs-teletext

Now run this command sudo

pip3 install -e .[CUDA,spellcheck,viewer]

For latest versions of Ubuntu like 23.04 the installation is done using

pipx install -e .[CUDA,spellcheck,viewer]

Without using any sudo.

Now run a deconvolve, you should see a performance increase and no errors about incompatible CUDA hardware

OpenCL

In order to use OpenCL you need to install pyopencl and the appropriate opencl runtime for your card.

Install OpenCL

pip install pyopencl  

Using OpenCL Decoding

When running the deconvolve command use -O option.

Terminal Set Up

In order for the teletext output to be rendered correctly in a terminal you need to use a specific font on said window. See Terminal Set Up.

Software Usage

Run each command with --help for a complete list of options.

Then Indexing and breaking it down into pages.

.tbc - Time Base Corrected (Decoded video frames from vhs-decode/ld-decode/cvbs-decode)

.vbi - VBI Area Data

.t42 - Decoded Teletext Packets

Capture

Capture VBI via BT8x8, SAA7131, CX88 Based Chips :

teletext record -d /dev/vbi0 > capture.vbi

Capture full video signal RF data via CXADC or DomesDayDuplicator (DdD)

Connect video input & adjust gain level with

./leveladj

Capture via CXADC with

timeout 10s cat /dev/cxadc0 |pv > CX_Card_28msps_8-bit.u8

timeout 10s defines the capture duration of 10 seconds, this can be defined in hours minutes or seconds if a timeout duration is not set it will capture until storage space runs out or stoped manually with Ctrl+C.

Decode Capture with vhs-decode / ld-decode / cvbs-decode etc

./vhs-decode --debug --chroma_trap --pal --threads 8 --cxadc input_capture.u8 output_decode_name 

All decodes are in the TBC format with the full 4fsc signal frame for vhs this is just the tape_decode_name.tbc which only has the Y or Lumance data no chorma information.

Deconvolve a conventional VBI area only capture:

teletext deconvolve capture.vbi > stream.t42

Deconvolve a full-frame TBC file:

teletext deconvolve -c ddd-tbc INPUT_tape_decode_name.tbc

Status elements

While deconvolving some status elements are shown

959392L [13:49, 1156.75L/s, R:44%, M:|▅▁▁  ██|]
  • 959392L The amount of VBI lines already processed
  • 13:49 The time in minutes and seconds since the deconvolve started
  • 1156.75L/s The amount of VBI lines processed within a second. The more the faster the deconvolve is finished. It seems to include non-teletext lines as well, as with fever lines used for teletext the amount increases.
  • R:44% Amount of VBI lines rejected. This counts for lines in the VBI, that are not detected as teletext. The less lines are used for teletext the higher the amount is.
  • M:|▅▁▁ ██| Each block represents a magazine

Reading

View teletext data inside a TBC with:

teletext vbiview -c ddd-tbc INPUT_tape_decode_name.tbc

Examine the headers to find services on the tape:

teletext filter -r 0 stream.t42

Squashed approach to examine the headers to find services on the tape:
Helpfull if the captures are very long and contain a lot of data

teletext scan stream.t42

Split capture into services:

teletext filter --start <N> --stop <N> stream.t42 > stream-1.t42

Display all copies of a page in a stream:

teletext filter stream.t42 -p 100

Squash duplicate subpages, which reduces errors:

teletext squash stream.t42 > output.t42

Exporting

Generate HTML pages from a stream:

teletext html output/ stream.t42 

Interactively view the pages in a t42 stream:

teletext service stream.t42 | teletext interactive

In the interactive viewer you can type page numbers, or '.' for hold.

History

This is the second rewrite of the original software. The old versions are still available in the v1 and v2 branches of this repo, or from the releases page.

2023

  • OpenCL Support 30.03.2023

Recovered Data Examples

You can see collections of pages recovered with this software at: