Log in

View Full Version : Perfect TBC, component on VHS and other crazy experiments


jmac698
2nd November 2011, 00:17
http://www.sendspace.com/file/4gymw3

This is an experiment to answer the questions, what would a perfectly calibrated VHS look like?
What are the effects of tape, VCR, and capture card on noise, jitter, linearity, and
frequency response?

To answer the questions, custom software was designed and test recordings carefully measured.
The resulting technologies advance calibration far beyond the test patterns on typical
test DVD's. In essence, practically every measurable aspect of analog capturing can be optimized
to the fullest. These experiments are just beginning, but included is one example of it's
use.

How this video was created
First, the video was separated into it's component values (Y, Pb, Pr). Each image was recorded separately as a frame. It was also anamorphically squeezed.

Next, a special alignment signal was added to the video.

Upon playback, custom software aligned the video to within .1 pixel. While theoretically
perfect, the processing was affected by noise and distortion in the video.

Then the component frames were merged into a color composite. The anamorphic video was
unsqueezed. Finally the levels were perfectly stetched between the resulting black/white points.

The resulting video has only these distortions remaining:
-noise
-frequency response
-levels non-linearity
-some banding was introduced by the levels adjustment
-various other minor effects

Commentary on the Video
The video is fairly blurry as can be expected from VHS. The image is quite stable, but one
can see a slight movement in the edges of the colorbars. This can probably be eliminated
by further work in the software. The noise level is quite good for VHS. Sometimes there
is line jitter as the video exceeded the range of the software (this can be corrected too).
Finally, the bottom lines of the video look normal. In fact in the orignal, it was
badly slanted and had head switching noise. This part is normally cutoff, but now we
don't need to!

Further possibilities
HD
With this technique, pixel-perfect video can be recorded. This brings the possibility of
recording HD resolution. To do so, we would separate the HD image into 3x2 tiles or more.
Then each tile is recorded as a separate image. The tiles are then stacked back together
upon playback, increasing resolution 6 times. The only downside, is that the video takes
6 times as much tape!

The perfect alignment enables this technique because otherwise, it would be difficult to
piece the tiles together, as the borders would be wiggling into each other (due to jitter) resulting in obvious artefacts.

Noise reduction
We could also record the video twice, and average the noise upon reconstruction. If this
were done without alignment, the result would get much blurrier, as the two copies
would be overlapping each other.

Perfect linearity
Currently when you record brightness levels of 128,129,130 etc. we get back 128, 130, 130
for example, as the mid-tones are a little brighter than they should be. Though these
levels can be adjusted, there will be some banding as half of the mid-tone values have
disappeared. There could be a scheme of HDR where the shadows and highlights are recorded
as separate frames.

Frequency Response
Another test signal (frequency sweep) could be recorded to determine frequency response.
This can easily be undone with an FFT.

Other methods of encoding video
The alignment would be critical for other methods of recording video. For example the
video could be recorded as it's 2d FFT. In this case, mis-alignment would ruin the
results, possibly resulting in severe ringing effects.

Measuring VHS Parameters
Further test signals could determine the ideal noise profile of each VCR/Tape combination,
the jitter performance of a VCR/TBC/Capture card, frequency response, linearity, etc.

Using the VCR model to improve normal captures
Once we have an ideal model of these parameters, it can be used to tune normal VHS
captures to the highest quality. For example, a plain grey image with ideal noise
can be provided for use with the well-known Neat Video noise reduction program.
The frequency response profile can be used for sharpening. The linearity profile
can be used, with debanding, to improve the brightness curve (although this is usually
adapted to user preference anyhow).

Further work
There are many aspects to VHS recordings. We can further examine tint/saturation errors,
contamination between luma/chroma levels, chroma placement,
and other various linear/non-linear shifts within and between signals.

Example of my ideal TBC performance
http://screenshotcomparison.com/comparison/91487
You'll see some aliasing, that's due to a simple resizer to fix the jitter. On VHS you'd never notice.

Mounir
2nd November 2011, 02:00
The colors bars are close to perfection, verified with the videoscope, the little blue bar on the left is sharp unlike on my tries (blurry) and the IQ couldn't be more precisely tuned imo.Slightly more yellow than needed though.
The noise is close to perfection at least from an human eye perspective, from the histogram (in luma mode) perspective something tells me you've added some grain (cheater) i joke.A gray bar is missing in your test pattern (!?)

comparison (for noise): reference (http://imageupload.org/?d=1D6E3DFB1) ; Mournir's bars (http://imageupload.org/?d=913C18F71) ; Jmac's bars (http://imageupload.org/?d=A7BF5A0D1)

comparison (for colors): reference (http://imageupload.org/?d=7391857E1) ; Mounir's bars (http://imageupload.org/?d=71E23F331) ; Jmac's bars (http://imageupload.org/?d=99B43CE51)

I wonder how you did all that, probably with your magic tbc script and the several captures technique

Next step for you is to enlighten us

jmac698
2nd November 2011, 02:16
It's because of component on VHS, explained in the doc.
My levels were simply:

levels(blklvl, 1, whtlvl, 16, 235, false)

Where I took a quick reading of the original black/white on the colorbars.
The component trick is with this:

component?interleave(last,utoy.pointresize(last.width,last.height),vtoy.pointresize(last.width,last.height)):last

function uncomponent(clip v, int ph, bool "comp"){
#merge every 3 frames as component video
comp=default(comp, true)#true, show component, false, show composite (y)
#adjust these for a particular recording
v
y=selectevery(3,(ph+0)%3)
u=selectevery(3,(ph+1)%3)
v=selectevery(3,(ph+2)%3)
ytouv(u,v,y)
comp?last:y
assumefps("ntsc_film").converttoyv12
}

jmac698
2nd November 2011, 02:23
Here's what you're probably looking for:
http://screenshotcomparison.com/comparison/91499

Pretty neat actually, it shows that VHS color is centered on the transition.. I don't know how though, the VCR can't know a color change is coming? Hmm anyone know more about VCR's?

jmac698
2nd November 2011, 02:26
I should write a script to fix the color in composite, shouldn't be hard...

That analysis was pretty cool. I see what you mean about the grain, very interesting! I wonder if my capture card is using some kind of dither?? Also I think I can do even better, I think if I use R,G,B frames it would be more precise.

Mounir
2nd November 2011, 03:47
Glad i can help i suck at maths (and thus avs scripting ) but i may have other talents (i hope)

I would be very surprised that your capture card dither frames, it's more likely an effect of your process, which is still unclear for me

Ghitulescu
2nd November 2011, 09:00
maybe I'm rusty by now, but I haven't got the "message" - the file you posted is something that has to be recorded on a VHS then analysed by your software, or the result of a capture (I don't see the head switching noise, but I do see dropouts :)
:confused: :confused: :confused:

pandy
2nd November 2011, 10:55
VCR store chroma bellow luma band - they not share like in case of "normal" composite signal band - instead of this luma part is FM modulated AFAIR in band 1.1MHz up to around 2.5 - 3 MHz, chroma part is also FM modulated and it is bellow 1MHz.

Gavino
2nd November 2011, 11:12
function uncomponent(clip v, int ph, bool "comp"){
#merge every 3 frames as component video
comp=default(comp, true)#true, show component, false, show composite (y)
#adjust these for a particular recording
v
y=selectevery(3,(ph+0)%3)
u=selectevery(3,(ph+1)%3)
v=selectevery(3,(ph+2)%3)
ytouv(u,v,y)
comp?last:y
assumefps("ntsc_film").converttoyv12
}
Surely u and v need to be PointResize'd down by a factor of 2?

Ghitulescu
2nd November 2011, 11:38
VCR store chroma bellow luma band - they not share like in case of "normal" composite signal band - instead of this luma part is FM modulated AFAIR in band 1.1MHz up to around 2.5 - 3 MHz, chroma part is also FM modulated and it is bellow 1MHz.

http://oi39.tinypic.com/j7sqc0.jpg

jmac698
2nd November 2011, 11:57
@Ghitulescu,
The file is a recording from a VHS, which has been processed in 3 ways; 1 levels adjustment 2 dejitter 3 "component on VHS".
If you look at the further screenshot, you can see the raw footage which has been processed in 2 ways: 1 levels adjustment 2 dejitter (aka "normal" VHS). http://screenshotcomparison.com/comparison/91499

@Gavino
True! But this has worked a few times for me, I don't know why! Let me investigate further.

@mounir
Try colorbars.utoy you can see some odd grey version of the colorbars. This is one half of the color signal. There is also vtoy. Together U, V make the tint and saturation. greyscale is the luma. The 3 signals are now the complete video (just as R, G, B can also make video). I recorded these 3 images as a video onto the tape. When I process the tape, I combine the images again, to form the colors. This is why the colors look better; they have the same relative levels, also they have the same color resolution as the luma, since they were recorded as a grey signal. Make any sense now?
----
Difficult is not the ideal chroma -- difficult is to hide her from the luma.

Gavino
2nd November 2011, 15:13
@Gavino
True! But this has worked a few times for me, I don't know why! Let me investigate further.
I think I know - in 2.6, the output format is determined by the relative sizes of Y/UV, so if they are all the same size you end up with YV24 as output (perhaps without realising).