Quantcast Avisynth script to fix offset interlacing? - digitalFAQ Forum
  #1  
01-02-2018, 12:20 PM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,472
Thanked 1,391 Times in 1,223 Posts
Paging sanlyn.

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.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
01-02-2018, 05:05 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,445
Thanked 1,073 Times in 895 Posts
Quote:
Originally Posted by lordsmurf View Post
Paging sanlyn.

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.
Reply With Quote
  #3  
01-03-2018, 12:46 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,472
Thanked 1,391 Times in 1,223 Posts
Sample attached.

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.


Attached Files
File Type: avi sample.avi (45.81 MB, 3 downloads)

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #4  
02-10-2018, 02:34 PM
keaton keaton is offline
Premium Member
 
Join Date: Jan 2017
Posts: 37
Thanked 8 Times in 7 Posts
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.
Reply With Quote
  #5  
02-10-2018, 05:34 PM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,472
Thanked 1,391 Times in 1,223 Posts
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.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
VCR simulator script, Avisynth fake VHS look! jmac698 Restore, Filter, Improve Quality 1 02-12-2018 06:17 AM
XviD and Interlacing Tytanic Capture, Record, Transfer 12 05-10-2016 04:03 PM
Avisynth script for QTGMC, encode x264 - no video after deinterlace? mo418 Capture, Record, Transfer 18 09-16-2015 01:06 PM
Virtualdub and chroma interlacing unclescoob Restore, Filter, Improve Quality 6 10-25-2011 11:12 AM
Interlacing on HD progressive displays? admin Capture, Record, Transfer 2 12-02-2009 12:42 PM

Thread Tools



 
All times are GMT -5. The time now is 01:55 PM