Log in

View Full Version : VapourSynth Video Editor


jay123210599
29th August 2024, 19:50
What is or which video editors use VapourSynth? Can they make image sequences out of videos?

ChaosKing
29th August 2024, 20:04
You can try imwri.Write(), see https://amusementclub.github.io/doc/plugins/imwri.html#imwri.Write

Vdub2 can open vapoursynth files and supports saving as Image Sequence.


I would say the "best" editor currently is https://github.com/Jaded-Encoding-Thaumaturgy/vs-preview
Second place https://github.com/YomikoR/VapourSynth-Editor

_Al_
29th August 2024, 22:22
Best, simple previewer is mine! :-) , it can preview many clips at the same time and switching between then using keys on keyboard
https://github.com/UniversalAl/view
but seriously, it is a crude, simple player, using opencv, nothing extra, but using it with any python editor,
you use it in your script:


import vapoursynth as vs
from view import Preview
source = r'my_source.mkv'
clip = vs.core.ffms2.Source(source)
clip.set_output()
if __name__ == '__main__':
Preview([clip])
if preview is in that "if" block like that, script can be loaded into vspipe, no need to remove those previewing lines.
But if you run your script from a python editor, like IDLE (very basic, good for a beginner, easy, run script) or pycharm (advanced, but if you handle that, there is no way back to anything else). In that other post of yours a VirtualDub editor was used for previewing scripts, but I did not use that, not sure how it performs here.

That view.py can export PNG frame 1:1 if pressing key "W", if pressing key "E" it saves image WYSIWYG, like zoomed in. Both save current crop, if applied.
It saves even during playback, if pressing "W", it will save images in a sequence, until you release that key.

Using vapoursynth you become a python coder, if you want or not, so you can use python editors like that.

_Al_
29th August 2024, 22:44
Also as was suggested imwri plugin could be used, https://github.com/vapoursynth/vs-imwri/releases/tag/R2 , you would find out in a previewer what frame range you want to get and then writing images you'd use script ,something like:

import vapoursynth as vs
source = r'my_source.mkv'
clip = vs.core.ffms2.Source(source)
clip.set_output()
if __name__ == '__main__':
clip = clip.resize.Bicubic(format=vs.RGB24, matrix_in_s="709")
clip = vs.core.imwri.Write(clip, filename='my_movie_%02d.png', imgformat='PNG')
#to write image sequence from frame 100 to 110
for frame in range(100,110):
clip.get_frame(frame)
So you could preview that script in your previewer that sets __name__ to "vapoursynth". vsedit does that, getting desired frame numbers for your sequence, and then running it in a python editor would actually write images.
Or you can use any previewer and when getting frame numbers, you'd add those lines that write png images.

_Al_
29th August 2024, 23:14
Also Comparator could be used, https://files.videohelp.com/u/198160/Comparator.7z , thats a download link from videohelp, it is a GUI, a major step up from view.py (though not finished as I wanted to be, not having time) .
Everything is set up already, it is compiled. No need to download opencv modules in python etc. Keys "w" or "E" work as well I think, you can change path for saving images in settings.

Just drop your vapoursynth script on that Comparator exe (or more scripts to compare them). Or as a matter of fact, you can just drop your video file (or video files), it will create scripts internally automatically.
It looks like this:
https://forum.videohelp.com/attachment.php?attachmentid=61238