Mr Alpha
22nd June 2016, 15:50
I have a vapoursynth script I use to compare pre- and post-encodes. It essentially crops away half och each and then stacks them vertically:
import vapoursynth as vs
core = vs.get_core()
old = core.ffms2.Source(source='input')
new = core.ffms2.Source(source='output')
old = core.text.Text(old, 'Old', 9)
new = core.text.Text(new, 'New', 3)
crop = old.height//2
old = core.std.CropRel(old, bottom=crop+2)
old = core.std.AddBorders(old, bottom=2)
new = core.std.CropRel(new, top=crop)
video = core.std.StackVertical([old, new])
video.set_output()
Now I wonder if there was a way to adjust the crop on per frame basis. Something like:
crop = n % (old.height - 2)
where n is the frame number.
I can't seem to figure out a good way to do this.
import vapoursynth as vs
core = vs.get_core()
old = core.ffms2.Source(source='input')
new = core.ffms2.Source(source='output')
old = core.text.Text(old, 'Old', 9)
new = core.text.Text(new, 'New', 3)
crop = old.height//2
old = core.std.CropRel(old, bottom=crop+2)
old = core.std.AddBorders(old, bottom=2)
new = core.std.CropRel(new, top=crop)
video = core.std.StackVertical([old, new])
video.set_output()
Now I wonder if there was a way to adjust the crop on per frame basis. Something like:
crop = n % (old.height - 2)
where n is the frame number.
I can't seem to figure out a good way to do this.