Unfortunately, the problems is still there when I play the video directly rather than using Avisynth. I'm working on a function which uses ConditionalFilter to detect frames with this problem and shift them up by an appropriate amount. I've written several versions because it would correct some frames and not other. Additionally, a few versions shifted frames that did not need correction. The current version is supposed to detect the edge between the blank area at the top of a shifted frame and the actual frame using RGBDifference(), but this version has stopped working all together. Here's the line I think is to blame.
inc = ConditionalFilter(inc,inc.Crop(0,22,0,0).Addborders(0,0,0,22),inc,"RGBDifference(ConvertToRGB().Crop(0,21,0,-218),ConvertToRGB().Crop(0,22,0,-217))","greaterthan","0.03")
I have several similar lines in the script to correct different amounts of shift. This one is for a 22 line shift. My test frame is shifted by 22 lines, but this script fails to correct it. And in case you're wondering why I'm doing an intermediate conversion to RGB and using RGBDifference() instead of AverageLuma(), it's so I can create test clips that are a single scan line tall.
|