Al's Website

Just another WordPress site

Generating Teletext in Software

| 7 Comments

It has long been known that commodity PC graphics cards can, with a custom modeline, generate an “almost” PAL video signal. You only need to use a simple sync converter to get a picture on most TV sets. This allows you to skip the TV out filter (if you even have one) and control the signal more or less however you want. I wondered if this would be good enough to feed a teletext signal into the TV set, and it turns out that it is.

I have implemented the teletext specification in python code, and generate the encoded video lines as a bitmap. This then has to be “tuned” to the TV set/video card combination by scaling it horizontally to get the correct timing. Then I display the result at the top of the picture using a modeline with lots of overscanning. The result looks a bit like this:

VBI data as an image.

I use the VGA2SCART converter described at http://www.nexusuk.org/projects/vga2scart/ with one modification: a 100 ohm resistor between the red and composite pins. This is needed as the teletext decoder works from the composite video signal. The 100 ohm resistor puts some of the red signal onto the composite without affecting the picture too much. A better design could generate a real composite signal from the RGB without much difficulty. eg this one: http://www.nexusuk.org/projects/rgb2svid/circuit

I use a modeline which gives 609 lines on the output. This gives 5 usable lines of teletext with my TV. Again, this probably needs to be tuned for each set/video card to get a usable picture.

This is the modeline I use, with an nvidia MX4000:

ModeLine "768x609pali" 14.750 768 789 858 944 609 614 619 625 -hsync -vsync interlace # Analogue w/ extra lines

I have a modified version of alevt which can dump a whole channel’s worth of magazine pages, and I can then feed those back into the TV. Since this is a software solution there is no limit on the amount of pages except how long you are willing to wait for the carousel to repeat. With 5 lines it is about as fast as the real thing. I even replicated the clock lines.

Teletext spec is available here.

Teletext on my TV

7 Comments

  1. Very interesting, I had been wanting to do something similar myself but was unsure how to start. Any chance the source code is available to study?

    • The source code is not available, but it’s really bad anyway. The principle is simple anyway, and hardest part was getting the correct modelines.

  2. Thanks for the response. I’m trying to get NTSC line 21 captions working, I know the principle is basically the same as teletext, although I’m sure I’ll have to change the modeline. I’m guessing it’s not as simple as changing the 768 and 609 to 728 and 525, any pointers as to how you came up with the modeline? Thanks!

  3. Actually I’m trying to do this on a Raspberry Pi PC with composite out so probably the modeline isn’t the issue, but rather how to generate the pixel data

  4. Recently I have a problem in getting the teletext data from the incoming video data,that is the did and sdid is different from used to use,can you tell me what’s the DID and SDID in teletext system A/B/C/D (WST) respectively? Thank you!

  5. Pingback: Teletext Revival, Part 1: What Is It? | The New Tech

Leave a Reply

Required fields are marked *.