digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Avisynth script to fix offset interlacing? (https://www.digitalfaq.com/forum/video-restore/8386-avisynth-script-fix.html)

lordsmurf 01-02-2018 12:20 PM

Avisynth script to fix offset interlacing?
 
Paging sanlyn. :cool:

I have an odd VHS video where the fields are wonky. It looks like the camera has double vision.
If you run separatefields(), the problem is obvious.

Every odd frame is fine.
Every even frame is shifted down about 4 pixels.

I need an Avisynth script to shift the fields back into correct position. But I'm just coming up blank of what syntax to use here.

sanlyn 01-02-2018 05:05 PM

Quote:

Originally Posted by lordsmurf (Post 52024)
Paging sanlyn. :cool:

I have an odd VHS video where the fields are wonky. It looks like the camera has double vision.
If you run separatefields(), the problem is obvious.

Every odd frame is fine.
Every even frame is shifted down about 4 pixels.

I need an Avisynth script to shift the fields back into correct position. But I'm just coming up blank of what syntax to use here.

Remember that SeparateFields() shifts odd fields downward 1 pixel. A sample or image is in order.
First convert the video to 4:2:2, unless it's already RGB.
Then SeparateFields()
Set e = Select the even fields, crop (0,4,0,0) takes 4 pixels off the top, then AddBorders(0,0,0,4) adds 4 pixels to the bottom and shifts the image up...

Code:

ConvertToYUY2(interlaced=true)
SeparateFields()
a=last
e=a.SelectEven().crop(0,4,0,0).AddBorders(0,0,0,4)
o=a.SelectOdd()
Interleave(e,o)
Weave()
Crop(0,0,0,-8).AddBorders(0,4,0,4)
return last

Hope it works. This is just guessing without a sample. It worked on an interlaced sample I had on hand, but my sample has no existing top or bottom border.

lordsmurf 01-03-2018 12:46 AM

1 Attachment(s)
Sample attached. :salute:

Your code actually made it worse, so looking to tweak it now.

Although it appears to be 2 or 4 fields deep. it was actually only 1 pixel off. I did forget that separatefields() was already shifting it.

This worked:
Code:

SeparateFields()
e=SelectEven().crop(0,1,0,0).AddBorders(0,0,0,1)
o=SelectOdd()
Interleave(e,o)
Weave()

This video error appears for about 5 minutes, then recedes. Repeat on the entire tape (30-40 minute VHS-C). Though tedious, it's easily fixed in an NLE once the footage is corrected.

The timing on it is horrible. With a line TBC in a JVC, it vertically jitters nonstop. With a Panasonic AG-1980P field TBC, it has this interlace reversal issue. With no TBC, it does everything from tearing to wiggling to jittering. That is obviously the root cause of the error, but I'm not sure why Panasonic is grabbing the wrong line. I can only guess that the line is so damaged as to disappear from its detection?

I've not yet tested for field dominance, and hope that won't be an issue.
Worst case is I just run QTGMC on it. At least that's an upgrade from drop-field.

BTW: For some dumb reason, I forgot e,o (in my case a,b) in interleave. Oops. That's why I was having a syntax issue.

Thanks. :)

keaton 02-10-2018 02:34 PM

Just wanted to give a very big thank you to lordsmurf for asking about this, and to sanlyn for posting this little bit of code! I tried it, and I think it's going to be the solution to what's been troubling me with JVC TBC/NR feature having moments of vertical jitter. It will be tedious to inspect every frame of video, but it's better than trying to splice together multiple captures with tracking and/or tape path adjustments. It's easier to work digital than analog! :)

Just as an aside for anyone who might also be in this situation. I had the same issue as LS described here using JVC Line TBC/NR feature. I found when I turned it off (and without the video stabilizer feature turned on), the jitter went away. But, of course, without that the chroma suffers. Most of the jitter is for one to a few frames every couple/few minutes. Some spots had pretty much continuous jitter for several minutes. But I found making a slight tweak to the tape path screw by the video drum can greatly reduce those spots that heavily jittered for several minutes. Although if I go too far, the HiFi audio can get some crackles. The JVC TBC/NR is a wonderful feature, but it seems a bit sensitive.

lordsmurf 02-10-2018 05:34 PM

The S-VHS tape I had refused to even play on a JVC deck, complete noise and instability. It was too much for the JVC line TBC to handle. The Panasonic multi-line/field TBC made the tape mostly behave, but this was the side effect.

Then you have a JVC that show momentary jitter every several minutes, it's again the tape.
I know for a fact that
(1) using JVC S-VHS as the recording deck
(2) leaving calibration ON while recording (never do this!)
(3) then playing back in a JVC, even the same JVC that recorded the tape, shows jitters
(4) yet tape plays fine in AG-1980

^ An offline friend, and a long-time member of this site (though rarely posts, just reads), made that mistake. I had to convert all of his VHS recordings for him. He made that exact mistake.

The recording quality is the issue, not the player. Always remember that.


All times are GMT -5. The time now is 10:34 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.