Daily Archives: 1/24/2012

Creating source material for Narrow Band TV…

I’ve often thought that creating a replica of an early Baird mechanical television, or televisor would be a fun project. But when starting, you immediately run into the problem of how to generate material for them. The Narrow Band Television Association standard format specifies 32 line format at 12.5 frames per second (400 lines per second). It also specifies an aspect ratio of 2/3, which means that if we are using square pixels, we want to resize to an output resolution of just 32×48 (yes, images are taller than they are wide). I thought about using some old Coronet films like Are You Popular as appropriate source material, and worked to create an ffmpeg command (my goto Swiss Army knife of video conversion) and came up with the following command line to crop the existing video into the 4:3 video into a 2:3 video and resize it to 48×32:


ffmpeg -i AreYouPo1947.mpeg -vf 'scale=640:480,crop=320:480,scale=32:48' -r 12.5 -aspect 2:3 televisor.mp4

You can then play televisor.mp4 and see (in a very small window) what televisor video might look like. But how can we turn this into a sound file like we need to drive a televisor? Well, we need 400 lines per second. A CD’s natural format is 44100 Hz. That’s 110.25 samples per line (bummer, it doesn’t divide evenly). We could round it down to 110 or so (not bad) or we could generate our samples at 48000 hz instead of 44100 and use a high quality downsampler to generate the final audio. Either is acceptable. We can make life easy on ourselves by using ffmpeg to generate individual video frames with the the right number of vertical samples (either 110 for 44100 or 120 for 48000) and generate .pgm files (which are very nearly the raw 8 bit sample values we need):


ffmpeg -i AreYouPo1947.mpeg -vf 'scale=640:480,crop=320:480,scale=32:120' -r 12.5 -aspect 2:3 frame.%06d.pgm

With a little more work, I can transpose the files (so they are in column order as expected by the televisor) and then add the sync pulses we need. I’ll play around some more with this tonight, and then try it and verify my understanding using the NBTV viewer. Then, perhaps on to building a televisor.