Live data from Hacker News

An interactive look at how a video signal is made

blog.pizzabox.computer

11–19 of 19 posts

Re: An interactive look at how a video signal is made

#11
Cool thing about analog video was the ability to cheaply store a Lot of data using common VHS deck. Japanese started recording Digital PCM on Video tapes in 1977, long before CDs. This is why CD audio has 44.1 sampling rate - common divisor for fitting 3 samples per line of video in both 50 and 60 field rates.

https://www.youtube.com/watch?v=DLS9sQUxVlI

https://youtu.be/-ZJmQQ9OCtI?t=7240

In 1992 enterprising Russian company released a line of ISA controllers turning VHS into a streamer https://en.wikipedia.org/wiki/ArVid up to 4GB per tape at the time 4GB hard drive cost over $1000.

Re: An interactive look at how a video signal is made

#12
post #4

This is pretty cool. For about two to three years now, I've leaned very heavily into analog video signals as a hobby. It culminated into me making not just a software PAL decoder, but my own fully compliant PAL "graphics card" with an FPGA and analog circuitry. PAL might be one of the most complicated analog video signals next to SECAM (though PAL is not that far from NTSC if you understand it well already), and I wa…

Kindred souls. About three years ago, I did the same, but with NTSC. In my case I actually built a digitization board that sampled the signal from a composite cable and dumped the raw samples over USB using the Cypress EZ-USB2 chip. I didn't want to "cheat" with a chip that did the synchronization etc. :)

I never really finished it, but I threw a little bit of it on GitHub: https://github.com/gabesk/tv_python is the prototyping version (the raw data is a picture of Lena on a Raspberry Pi composite output).

Also as an aside, if anyone ever wants an example of how to stream data from an isochronous endpoint on Windows, this took me way to long to figure out: https://github.com/gabesk/tv/blob/master/actual_implementati... (see usb_reading_thread routine) as well as this blog post: https://gabesk.blogspot.com/2018/08/streaming-from-isochrono... (that version does real-time black and white, but I never finished real-time color as my laptop at the time couldn't handle it with my poorly optimized decoding routines).

You all have inspired me to finish this properly and publish it. Maybe even as a top level post on HN.

Re: An interactive look at how a video signal is made

#13
post #12
post #4

This is pretty cool. For about two to three years now, I've leaned very heavily into analog video signals as a hobby. It culminated into me making not just a software PAL decoder, but my own fully compliant PAL "graphics card" with an FPGA and analog circuitry. PAL might be one of the most complicated analog video signals next to SECAM (though PAL is not that far from NTSC if you understand it well already), and I wa…

Kindred souls. About three years ago, I did the same, but with NTSC. In my case I actually built a digitization board that sampled the signal from a composite cable and dumped the raw samples over USB using the Cypress EZ-USB2 chip. I didn't want to "cheat" with a chip that did the synchronization etc. :) I never really finished it, but I threw a little bit of it on GitHub: https://github.com/gabesk/tv_python is the…

Nice. I do know the feeling of "not wanting to cheat" by using existing solutions, where's the fun in that...

My PAL decoder is in Matlab, and so slow that it's mostly useless (because not realtime), but convenient for trying things out with the data, since you're already in Matlab... but the real goal was the eventually reached PAL generator anyway. That even found a practical use as well.

I think you should publish!

By the way, if you ever feel the itch to go back to it, try adding PAL support. It's NTSC with a few fun twists, nothing mind-bending though. The most "advanced" part of it is the delay line (which in practice will just be a line of memory).

Re: An interactive look at how a video signal is made

#14
This is a great visualization. I remember playing with generating VGA through bit-banging an Arduino - it was my course project for a class in the first year of my PhD. I sadly never wrote up a detailed explanation of it, but a picture of the setup survives as my Twitter header: https://pbs.twimg.com/profile_banners/20347234/1463010760/15...

The pixel clock (640x480 at 60fps) is supposed to be ~25 MHz, while the little Arduino Nano only runs at 16 MHz, so the implementation cheats a bit and gets the timings somewhat wrong (plus, it smears the pixels a bit, but I hid this by having relatively blocky graphics). Some TVs I tested with didn't like this signal much, but luckily the projector that I did the final demo on didn't mind the spec violation. For the actual demo I had a simplistic version of Tetris running (with sound!); all the computation happened during hblank and vblank because the main picture time was just a handwritten assembly loop shoving pixels out.

Re: An interactive look at how a video signal is made

#16
I always want to make a nice-looking infograph for Wikipedia on the TV color bars, with colors, labels, and explanations of the staircase waveforms, black level, color burst, etc (basically combining all annotations in a textbook to a single image). Most people have only seen the color bars as an image, but the more interesting aspects can only be seen on a TV waveform monitor, if the signal is properly adjusted, you can see the "staircase" waveform align to the etched mark on the CRT (not a particularly good graph: https://www.maximintegrated.com/content/dam/images/design/te...). Currently, Wikipedia articles on NTSC/PAL don't have any explanation on how an analog video signal is made. Too bad that I don't know anything about image editing (I did export a waveform from the ADS simulator, waiting to be visualized indefinitely).

Also, if anyone has a high quality photo of the Philips PM5544 video signal generator, please upload it to Wikipedia. This machine is an important artifact of popular culture, yet photos of the signal generator itself is uncommon on the web (and many people mistakenly believed the PM5544 is just a test card, not a signal generator), but so far there's no high-quality photo under a free license. (Or leave a comment if you have the actual machine, I'd pay $1000 for that. If I ever get the machine, I'll take a photo and upload it, and write a blog post about how the circles and lines are drawn by the analog circuitry). Finally, manuals, manuals and manuals: I'm willing to buy any documents about the Philips PM5544 (or any notable signal generators) to get them digitized. Currently the only document on the web is an issue of Philips Electronic Measuring and Microwave Notes [0] that only briefly mentions a tiny bit of its inner working.

[0] https://frank.pocnet.net/other/sos/Philips_PM5544_PM3400_Pub...

Re: An interactive look at how a video signal is made

#17

I always want to make a nice-looking infograph for Wikipedia on the TV color bars, with colors, labels, and explanations of the staircase waveforms, black level, color burst, etc (basically combining all annotations in a textbook to a single image). Most people have only seen the color bars as an image, but the more interesting aspects can only be seen on a TV waveform monitor, if the signal is properly adjusted, you…

> Or leave a comment if you have the actual machine, I'd pay $1000 for that.

I am sure the specific significance of the PM5544 is what you are looking for, but FYI there are plenty of PM5570 and PM5640 in Germany and UK ebay seller listings.

Just thought I would mention that if that is of interest to you.

Re: An interactive look at how a video signal is made

#18
post #11

Cool thing about analog video was the ability to cheaply store a Lot of data using common VHS deck. Japanese started recording Digital PCM on Video tapes in 1977, long before CDs. This is why CD audio has 44.1 sampling rate - common divisor for fitting 3 samples per line of video in both 50 and 60 field rates. https://www.youtube.com/watch?v=DLS9sQUxVlI https://youtu.be/-ZJmQQ9OCtI?t=7240 In 1992 enterprising Russian…

> This is why CD audio has 44.1 sampling rate - common divisor for fitting 3 samples per line of video in both 50 and 60 field rates.

Indeed. Naively multiplying the line frequency (15734Hz in NTSC, 15625 in PAL) by 3 doesn't fit, but if some room is made to make a really valid video signal, which implies 50 or 60 gaps per second, and some logic to play samples at correct point in time, then it fits.

Ref: https://en.m.wikipedia.org/wiki/44,100_Hz

Re: An interactive look at how a video signal is made

#19
post #11

Cool thing about analog video was the ability to cheaply store a Lot of data using common VHS deck. Japanese started recording Digital PCM on Video tapes in 1977, long before CDs. This is why CD audio has 44.1 sampling rate - common divisor for fitting 3 samples per line of video in both 50 and 60 field rates. https://www.youtube.com/watch?v=DLS9sQUxVlI https://youtu.be/-ZJmQQ9OCtI?t=7240 In 1992 enterprising Russian…

Crazy. I’d always thought it was because of Nyquist and the 20k ish human hearing limit.
Post reply on HN