Log in

View Full Version : Ragged vertical lines


mg262
16th June 2004, 18:32
Let me shamelessly exploit your brains again...

I'm capturing from a copy of an old VHS tape through a VCR with a TBC and I get the following effect:

http://testtesttesttest.50megs.com/images/window.jpg

presumably caused by the fact that the TBC isn't working perfectly, i.e. that some scan lines are slightly advanced or retarded compared to where they should be. This is more of a problem than the picture indicates because the scanlines (and hence the vertical lines) wobble from frame to frame.

As far as I'm aware there are no filters which deal with this (*please* correct me if I'm wrong)... I can think of a few ways to fix it, but they're probably riddled with holes + I'd appreciate any criticisms or better ideas...

1. Work through frames in order; shift each scanline by -2 pixels, -1 pixels, etc ... 2 pixels and find the one that is the closest match to the corresponding scanline in the previous frame. Closeness can be measured by e.g. the sum of the squares of the difference of luma (the 2-norm). This may well need half pixel or better accuracy.

Of course scanlines should be compared with the adjusted scanlines in the previous frame, and it's probably necessary to stop incremental shifts accumulating.

2. As above, but compare each scanline to the previous scanline in the field -- so essentially a special version of the above.

3. A better solution would be to try and find edges and remove any wobble in them, but this would be much harder to implement than the above...

Mohan

Arachnotron
16th June 2004, 18:51
I am unaware of any filters correcting for this, but there may be some.

The problem would be establishing a reference. For all the filter knows, you might have been capping MTV and this is an intended effect. A TBC can use the horizontal sync pulse as reference, but of course this is no longer present in the final cap file.

The only chance for a filter like that I can see would be to try to align the the black bars resulting from the horizontal blanking at the edges. But that only works with an ITU card that has a capture window that is wide enough to cap some horizontal blanking at the edges. And it would still break down the moment something black shows up in the picture. (maybe a rule: if more than 2 pixels shift is needed, dont shift at all?)

Which narrows it further down: it could work IF the tape is NTSC-M, where there is a difference between blanking level and black lever AND the card caps the full ITU window AND the card does not clip the black.

Also, I think you would need to interpolate new pixels rather than shift a set number of pixels, since there may be variation in line length too.

Correcting this would be difficult, I'm afraid. Trying to blur it might be the only option.

trevlac
16th June 2004, 20:27
You should post something like this in the Avisynth Development or Usage forum.

I'm sure there are many temporal noise filters you could give a try ... hard to say how each of them works.

As far as the entire scanline being shifted, that doesn't make complete sense to me. I think it more likely that each line does not have the same length to the next sync pulse, due to problems with the tape. So you would more likely have to adjust the line length, not shift the lines. It would be easier to just do a temporal noise reduction with a radius of 2.

Is this what you see when you play back on the TV? I'd also try to cap at a smaller frame width to see if that makes a difference.

BTW: I can appreciate your 'roll your own' approach. Helps me learn a lot if I do it that way. :)

mustardman
17th June 2004, 04:43
Hi,

I have also experinced a similar problem, although for quite a different reason...

I have a (field separated) sequence where an explosion has been taped, with an analog camcorder. I have an image (which is worth at least several words, maybe not quite a thousand) which I would dearly love to insert here. However, I don't have any webspace, and "IMG" insertion asks for a http address (can it be done otherwise? suggestions - please!).

Anyway, the top third of the image is perfect, then the shockwave obviously gets to the camera, because the horizontal sync becomes really wobbbly. Over the next few fields, this settles.

What would be nice is to straighten these edges and give a decent picture of what happened.

Like your image, it too has black borders on the left & right of the active picture area. The "scan line" seems to be the same length for each line, just the sync was mis-read.

I have noticed that different cards can handle different amounts of this "wobble". It probably has quite a bit to do with the PLL implementation (regardless of whether it is digital or not).

No filters have ever been developed to correct this (to my limited knowledge anyway).

MM

jggimi
17th June 2004, 13:30
Moved to the AviSynth usage forum (to find a wider filtering audience).

Wilbert
17th June 2004, 13:57
As far as the entire scanline being shifted, that doesn't make complete sense to me. I think it more likely that each line does not have the same length to the next sync pulse, due to problems with the tape. So you would more likely have to adjust the line length, not shift the lines.
Good luck! Do you think these differences in line length (compared to *other* captures) is random? In that case, I don't see what to do in theory.

Btw, is that with all your tapes?

Just buy a new VCR, and ask your money back for the old one.

Arachnotron
17th June 2004, 16:32
Just buy a new VCR, and ask your money back for the old one.

I own a VCR with build-in TBC too, and with some tapes the pic shown is about the best you can get. (try disabling it and see what you have without it)

TBC's cannot work miracles, there is a point where to much info was lost and to much junk was added over time.

mg262
19th June 2004, 11:38
You should post something like this in the Avisynth Development or Usage forum.

Oops... I'm really sorry... thanks for moving it, jggimi.

I can't find a frame that makes it clear whether shifting or squeezing is going on... but in either case I would be trying to guess the degree of shifting/squeezing information rather than trying to reconstruct the sync pulse in some arcane fashion.

So guess it by e.g. using the fact that a scanline typically looks very like the same scanline in the next frame and that a scanline typically looks like the next scanline in the same field. This wouldn't get rid of the effect entirely, but it would ameliorate it.

I really don't think it's the VCR... just an old tape that's been copied by someone without a TBC.

I could use a temporal blur, but because some of the edges involve a sharp luma transition, it would have to be a straight blur rather than a soften and that would cause ghosting...

I'm not sure it is worth going to all this trouble for one tape! Anyway thanks for the thoughts...