Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Apr 2024
Posts: 324
|
vspreview: Wrong Length in Time, part 3
I think I finally found a solution to my problem. When I insert my video to VirtualDub2, it inserted duplicate frames where timestamps have gaps to convert variable frame rate videos to constant frame rate. How do I do that in vspreview?
Last edited by jay123210599; 4th January 2025 at 16:02. |
![]() |
![]() |
![]() |
#2 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
https://github.com/Irrational-Encodi...synth-VFRToCFR |
|
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: May 2011
Posts: 364
|
You do not use it with vspreview. You have to stop that nonsense that blocks you to reason yourself. :-)
You are constructing a vapoursynth/python script. The needed line for vapoursynth script is on that page you were recommended. All you need is to have: -download that dll that you find on release page and put it in vapoursynth/plugin directory -come up with a clip in vapoursynth using a source plugin -timecode filepath, that some source plugin can make, not sure now, I thing ffms2 (look in options) or some other app. After you construct your vapoursynth/python script, you choose vspreview, OR ANY OTHER vapoursynth previewer, and play that script's set output. |
![]() |
![]() |
![]() |
#8 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Which "vspreview" are you referring to ?
The "job" of vs-preview is to open (preview) .vpy scripts https://github.com/Jaded-Encoding-Th...rgy/vs-preview Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: May 2011
Posts: 364
|
Yes, there are more versions , from original author, and some fork as well? Guessing that Jaded-Encoding-Thaumaturgy fork, but it might be the same with original version.
There is always a chance that a docs directory is included od github website, written by author, if not in detail on that main page, so you dig in its structure, finding this page: https://github.com/Jaded-Encoding-Th...s/installation There is a detail workflow how to use it with notepad++, vim and Visual Studio Code. Where if you have any of those, you can associate *.vpy extension to run it from within those softwares. Or you use some other software for editing, you can look into manual for that software how to associate execution of that created text file/ your script to what executable. That could be done using other editors out there. Or you can just use command line: python vspreview script.vpy, I guess that would work as well Or you can use a python editor, like Pycharm, my favourite, but not straight forward, especially starting it first time to set up things or IDLE, simple, easy to start first time. Naming your file script.py (not vpy), and juat runnin a command line using that edited script after saving it first. Dedicated python editors are custom tailored to python language and you can see many corrections and hints what to do, what is wrong , mainly advanced versions, especially PyCharm. But you'd have to give it a time to start with PyCharm. |
![]() |
![]() |
![]() |
#10 | Link | |
Registered User
Join Date: Apr 2024
Posts: 324
|
Quote:
Last edited by jay123210599; 6th January 2025 at 02:07. |
|
![]() |
![]() |
![]() |
#11 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
If you mean "alongside" as in "side by side", use StackHorizontal http://www.vapoursynth.com/doc/funct...orizontal.html You don't need to open a vpy, you can reference the video(s) directly with source filter(s) If you wanted to import a vpy directly , you could use SourceFileLoader https://forum.doom9.org/showthread.php?t=175098 All this is done in the script. vs-preview is just a preview for the script (that's it's main job) |
|
![]() |
![]() |
![]() |
#12 | Link | |
Registered User
Join Date: Apr 2024
Posts: 324
|
Quote:
Code:
clip1 = core.lsmas.LWLibavSource(r"path to clip1.mkv") clip2 = core.lsmas.LWLibavSource(r"path to clip2.mkv") clip3 = core.lsmas.LWLibavSource(r"path to vfr to cfr.vpy") |
|
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
If you want to stack them side by side by side, use StackHorizontal. They must be the same dimensions and pixel format, otherwise you have to convert them in the script so they share common characteristics before stacking e.g Code:
stack = core.std.StackHorizontal([clip1,clip2,clip3]) stack.set_output() |
|
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: May 2011
Posts: 364
|
As was recomended, you'd need SourceFileLoade. It is possible to use just module attributes or other ways, but most comfortable is using that SourceFileLoader.
Last post in that link, regarding SourceFileLoader, Selurs post, that was provided explains that. Just the end is a bit different, because vs.get_output() gets VideoOutputTuple object now in latest vapoursynth versions, that post is much older. Now, that vs.get_output() has three items (clip, alpha, alt_output), so to get clip, you'd need something: Code:
import vapoursynth as vs from vapoursynth import core from importlib.machinery import SourceFileLoader clip1 = core.lsmas.LWLibavSource(r"path to clip1.mkv") clip2 = core.lsmas.LWLibavSource(r"path to clip2.mkv") SourceFileLoader("my_clip", r"path to vfr to cfr.vpy").load_module() clip3 = vs.get_output().clip stack = core.std.StackHorizontal([clip1,clip2,clip3]) stack.set_output() Last edited by _Al_; 6th January 2025 at 05:27. |
![]() |
![]() |
![]() |
#15 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Whoops - I meant use the filter(s) directly in the same script (whatever you used in "path to vfr to cfr.vpy")
Code:
clip1 = core.lsmas.LWLibavSource(r"path to clip1.mkv") clip2 = core.lsmas.LWLibavSource(r"path to clip2.mkv") clip3 = core.lsmas.LWLibavSource(r"path to clip3.mkv") clip3 = vfrtocfr.VFRToCFR(clip3....) clip3 = #whatever other filters like resize etc.... stack = core.std.StackHorizontal([clip1,clip2,clip3]) stack.set_output() |
![]() |
![]() |
![]() |
#17 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
Code:
clip = core.lsmas.LWLibavSource(r'video.mkv') clip = core.vfrtocfr.VFRToCFR(clip, timecodes=r'yourtimecodes.txt' ,fpsnum=30000, fpsden=1001) clip.set_output() ffms2 can do CFR conversion too using fpsnum,fpsden, but I think it's slightly less accurate in some cases. This will be what vdub2 is doing Code:
clip = core.ffms2.Source(r'video.mkv', fpsnum=30000, fpsden=1001) clip.set_output() |
|
![]() |
![]() |
![]() |
#18 | Link | |
Registered User
Join Date: Apr 2024
Posts: 324
|
Quote:
|
|
![]() |
![]() |
![]() |
#19 | Link | |
Registered User
Join Date: May 2011
Posts: 364
|
Quote:
whatever_clip.set_output(), you can load it in vspreview because vspreview just looks for that thing. It does nothing else, it just loads that vapoursynth output in your script. It might read some clip props or even more, not sure now, but that is the basic. Btw. (even though never tested vspreview) I might have seen some images somewhere, you can load more index outputs and compare them there just changing indexes. For example trying: Code:
clip1 = core.lsmas.LWLibavSource(r"path to clip1.mkv") clip2 = core.lsmas.LWLibavSource(r"path to clip2.mkv") clip3 = core.lsmas.LWLibavSource(r"path to clip3.mkv") clip3 = vfrtocfr.VFRToCFR(clip3....) clip3 = #whatever other filters like resize etc.... clip1.set_output() clip2.set_output(1) clip3.set_output(2) Last edited by _Al_; 6th January 2025 at 09:48. |
|
![]() |
![]() |
![]() |
Tags |
vapoursynth, video comparison, video player |
Thread Tools | Search this Thread |
Display Modes | |
|
|