Sep 24

Video and horizontal compression

Category: Linux,multimedia   — Published by goeszen on September 24, 2013 at 3:05 pm

While digitizing VHS material, I had to inform myself about horizontal compression in relation to interlaced standard-def SD video. VHS already uses a slight horizontal squish to save bandwidth on recording. Then, when you read about digitizing VHS elsewhere, you often hear that it's okay to capture VHS at 360 or 352 horizontally. Also VHS is considered to resolve only about 300 luminance samples horizontally per scan-line. (All this refers to PAL, NTSC has 486 lines instead of 576)

Horizontal compression is when you have "non-square pixels". When this is done via lenses, its usually called anamorphic recording/material and is an effective way of compressing a widescreen image into a square recording area - reducing recorded information effectively. On presentation then, the pixels which contain squashed information are expanded again, becoming oval / stretched, interpolating the squashed image into an expanded image of correct visual aspect proportions; commonly DAR, display aspect ratio (vs PAR, pixel aspect ratio).

As an example, I've digitized an episode of Magnum P.I and did some screen caps of parts of the image:

The above image is a comparison of what various degrees of horizontal compression look like, when played back at a correct 4:3 visual aspect ratio (DAR, display aspect ratio). On the left, it's half horizontal resolution = 360x576 pixels instead of the original 720x576. The middle is three-fourths, 540x576 pixels compress by one quarter, and on the right the full resolution of 720x576 uncompress-non-anamorphic. The full console output of an avconv -i probe of the files is here.
In terms of kbps, it scales linearly, meaning the left is half the bandwidth, on my settings for this test, it was ~1000kbps, the middle is ~1500kbps and on the right ~2000kbps.
You can see quite well how fine lines get blurry and vertical lines become soft, like the "RTL" in the logo, also on the "PLAY" of the VCR's OSD.
For me, the middle setting is a good trade-off between quality and saving bandwidth, so I would suggest it's okay to digitize VHS at 540x720, giving it a slight squish.

This image is from a few seconds later in the episode. The strings of the parachute of this guy who lands on the beach, they blur into the background as much as you squash the image horizontally.

VHS might not resolve a lot information along a scan-line, but all that noise and analogue goodness of the medium does preserve quite a degree of information and when digitizing it you have to decide how much of it you throw away.

A note about the black bars on the left and right side of the image

VHS employs a bit of overscanning, means: it records more than what is usually played back on CRT screens. This overscan usually becomes visible when you capture the full frame and play it back on a modern TV or your computer. So, in a quest to trim down video size, would it be safe to crop off this overscan?

Many people do, that's why so many VHS digitizing guides advocate a resolution of 352 pixels horizontally (720 pixels - overscan ~ 2*8 = 704, divided by two = 352).

Still, it's not such a good idea, at least if you want to copy your videos to a DVD (or keep it in a compliant format). Actually, it's better to just mask off the noise in that area with really black areas. If you stick to a crop area that is a multiple of 8 or 16 (most encoder's sample size) - that may save you some kilobytes on the resulting, compressed video. You can read here how this can be done: How to reduce noise in overscan areas (when digitizing analog video)

And another side-note: VHS is interlaced video, which is a way of "vertical compression"

Up to this day, video broadcasts are compressed - or in other words: their bandwidth is reduced - by transmitting only half the image on every frame, it's an effective and unnoticeable way of reducing data with CRT television, and it's still employed with 1080i HD Television.

From a video capturing perspective, the result is that a recorded video is not full frames ("progressive"), but a sequence of frames where every frame carries only every second line, roughly.

So when you capture VHS video, you have to decide if you either keep it as interlaced half-frames (interlaced video) or if you de-interlace the video and store it as progressive frames (although at a lower vertical resolution, somewhat throwing away a bit of resolution that comes from alternating half-frames...). When digitizing VHS video, I try to archive the interlaced video as truthfully as possible, thus I strive to encode interlaced video with a codec which is capable of handling interlaced frames.
Yet, the whole process of interlacing is not very desirable. We have to live with it when handling VHS, but if possible, try to get a copy of progressive material if the original source ("negative") format was progressive - as with motion picture film, or recent digital cameras recording progressive video.

Leave a Reply