I don't have samples yet, but this is the problem:
FIELD A is fine
FIELD B is several interlace even-numbered lines below FIELD A.
It's almost looks like double vision.
Normally you have this (O=odd, E=even)
But this file is like this:
When you run separatefields(), the problem is obvious. One of the fields is downshifted by at least 2, maybe 4, lines. Drop-field deinterlace "fixes" it, but you get loss of detail (and jaggies, but santiag can fix those). Avisynth can probably repair this, but my attempt at syntax is wrong.
Anybody know why this happens? In the past 25 years, I've seen this issue maybe 5 times total.
+ Reply to Thread
Results 1 to 6 of 6
Nothing is missing, just typo on my part. E3, not E4.
Shifting was my idea as well.
But Avisynth syntax is my issue. What would a script look like?
I'm still not entirely sure I understand your problem, but here is code I used for video in which one field was shifted vertically relative to the other. You can enter your own "VShift" amount and see if this code helps. I wrote this to only apply the fix when it looks like there is a problem because I had a source where it didn't happen all the time. You can remove the conditional code (all the YDifference stuff) if you instead want to do the shift on every frame. If that is what you want, you delete everything between the output and weave lines so that the last two lines in the script are these:
output = interleave(even,odd)
# Script to both detect, and then fix, video in which one field has been shifted up by one line. # June 4, 2013 source=AVISource("e:\fs.avi").assumetff().bob(0,1) #Perform the shift on bobbed source by first cropping and then adding border Hshift = 0 Vshift = 2 even = selecteven(source) odd = selectodd (source) even = crop(even,Hshift,Vshift,0,0) even = addborders(even,0,0,Hshift,Vshift) #Alternate fix. Comment out two lines above, and remove comment from these lines. /* odd = crop(odd,Hshift,Vshift,0,0) odd = addborders(odd,0,0,Hshift,Vshift) */ output = interleave(even,odd) #The next two lines are used during debugging to make sure YDifference metrics #really do detect field shift reliably #script = """Subtitle("\nsource = " + String(YDifferenceFromPrevious(source)) + \ # "\noutput = " + String(YDifferenceFromPrevious(output)), lsp=0)""" #Scriptclip(output, script) fixed = output.scriptclip("""YDifferenceFromPrevious(source) > \ YDifferenceFromPrevious(output) ? output : source""") #Convert back to interlaced evenbob = selecteven(fixed) oddbob = selectodd(fixed) EvenOrig = separatefields(evenbob).selecteven() OddOrig = separatefields(oddbob).selectodd() interleave(EvenOrig,OddOrig) weave()
Although it appears to be 2 or 4 fields deep. it was actually only 1 pixel off.
SeparateFields() e=SelectEven().crop(0,1,0,0).AddBorders(0,0,0,1) o=SelectOdd() Interleave(e,o) Weave()
AviSource("sample.avi") AddBorders(0,0,0,1).Crop(0,1,0,0) # shift frame up (or down) by one scan line SwapFields()
Last edited by jagabo; 3rd Jan 2018 at 08:20.