Log in

View Full Version : vspreview with vs_align


jay123210599
14th December 2024, 21:26
Like I mentioned before, I have different videos that I want to compare to, but they are out of sync. How do I use vs_align to perfectly align the videos in vspreview?

https://github.com/pifroggi/vs_align

_Al_
15th December 2024, 03:03
Again, vs_preview has nothing to do with your thread questions, it is just a previewer that previews whatever is set for output in you vapoursunth/ python script, you confuse yourself and others.

from vs_align, I did not install it, just looked in manual, after you install pytorch and numpy (for precision=1 you might not need that, not sure, it looks like frame stats are used only), you might use temporal alignment,
clip = vs_align.temporal(clip, ref)
where clip is misaligned clip and ref is "normal" clip (your reference clip), precision=1 is default. Those two videos should be almost identical, just misaligned for precision=1. If those two videos differ in quality and colors a lot, you'd need to choose precision 2 or even 3.
Then, at the end of your script, you set both outputs, clip and ref and compare them in your previewer selecting particular outputs.

_Al_
15th December 2024, 03:20
but for a simple clips misaligning of your clips you can use trim or slice feature and do it manually,

clip=core.lsmas.LWLibavSource(r"misaligned.mkv")
ref=core.lsmas.LWLibavSource(r"ref_version.mkv")
#guessing ref is 15 frames ahead of clip, so cut those 15 frames from ref's beginning
ref = ref[15:]
#guessing clip is 15 frames ahead of ref, so cut those 15 frames from clip's beginning
#clip = clip[15:]
clip.set_output()
ref.set_output(1)
so by error and trial you come up with fine value to match them

jay123210599
15th December 2024, 14:42
I have 5 videos/clips.

poisondeathray
15th December 2024, 15:23
I have 5 videos/clips.

Align each one to the reference

jay123210599
15th December 2024, 22:08
Align each one to the reference

Which video should be the reference?

_Al_
15th December 2024, 22:33
It does not matter. Your choice. Maybe the best quality. But it has to be explained that way, what is reference video and and what video is adjusted.

poisondeathray
15th December 2024, 22:54
I would choose that has the most similar shared frames to the others as reference

e.g if you have 5 versions, perhaps different edits, different cuts - pick the one that the most shared frames with all the others . If you pick one that has the most missing frames compared to the others, it will not be as good candidate for reference