View Full Version : VapourSynth Editor 2


lansing
31st July 2020, 03:12
This is my continuation of the project.

New key features:

- A new detachable multi tab UI
- Similar clips comparison feature
- A new zoomable timeline for better navigation
- A bookmark manager to create/load chapter/bookmark files
- A new theme preset import/export system for the editor

Release page (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)
Changelog (https://bitbucket.org/gundamftw/vapoursynth-editor-2/src/master/CHANGELOG)

Requirement:
LibP2P library (https://github.com/DJATOM/LibP2P-Vapoursynth) is required after R6

Requirements the for preview filters
My fork of the vapoursynth-histogram (https://github.com/gundamftw/vapoursynth-histogram/releases)
The Akarin (https://github.com/AkarinVS/vapoursynth-plugin/releases) plugin for the contrast boost feature of the UV plane.

feisty2
31st July 2020, 14:48
there's a color picker (RGB picker), would be nice if there's also a coordinate picker (showing the location of your cursor on the preview image)

poisondeathray
31st July 2020, 17:07
x=,y= coordinates were present in an earlier test version...

lansing
31st July 2020, 19:28
there's a color picker (RGB picker), would be nice if there's also a coordinate picker (showing the location of your cursor on the preview image)

It is there, click on the frame info window on the right side, it is there

lansing
1st August 2020, 01:44
New update, I replaced frame display with QPainter. Previously the program was using QPixmap and uses its scaling function for zoom, which is a main cause of slow down when navigating with zoom. Now we can have 20x zoom without lag in playback.

changelog:

- PreviewArea now uses QPainter for frame drawing instead of QPixmap, which greatly improves performance for zooming
- Zoom ratio cap increases to 25x

poisondeathray
1st August 2020, 01:57
If you close the frame info (FI) tool , it's gone, there is no option to bring it back in the Window menu (bookmark manager is the only one there) . Personally, I like the frame info on the status bar instead of separate window

No error logging. If you hit preview and nothing shows, you don't know what went wrong or what line to debug

lansing
1st August 2020, 02:05
If you close the frame info (FI) tool , it's gone, there is no option to bring it back in the Window menu (bookmark manager is the only one there) . Personally, I like the frame info on the status bar instead of separate window

No error logging. If you hit preview and nothing shows, you don't know what went wrong or what line to debug

The Window menu will have options to bring those windows back.

The logging window is under the editor, just click on the arrow icon.

ChaosKing
2nd August 2020, 00:12
You can save some valuable space by placing the "script processor queue" label next to the bottom label.

lansing
2nd August 2020, 14:18
You can save some valuable space by placing the "script processor queue" label next to the bottom label.

That processor queue feedback should go somewhere near the video but I don't know where to put it yet. The thread count can go away. And the queue information needs to be more expressive because nobody knows what "0:0" means.


I have started to look at improving the autocompleter now. Some behaviors that need fix are :

- The print out of the all the parameters of the filter function. Nobody uses all of them and they are useless anyway because the parameters didn't come with default values. I will turn them into hints instead.
- The plugin auto completer list should pop out after the first input character and also be triggered after a period following a namespace. Right now the program is using one setting for both scenarios, which is not a good experience.

Adding script functions autocompleter shouldn't be a problem if the script writers all declare their nonfilter/helper functions as private functions. I'll just read all the py files and structure a script list from their function declarations.

The area that is still known to me is the vs classes and functions like VideoNode.set_output(), VideoFrame.width(). These needs autocompleter too, but where do I get a list of those names?

ChaosKing
2nd August 2020, 15:13
vsrepo can now generate a "vapoursynth.pyi" file wich contains infos for autocompletion engines or something like that... it should contain all core functions and plugin functions
https://github.com/vapoursynth/vsrepo/tree/master/vsgenstubs

lansing
2nd August 2020, 15:57
vsrepo can now generate a "vapoursynth.pyi" file wich contains infos for autocompletion engines or something like that... it should contain all core functions and plugin functions
https://github.com/vapoursynth/vsrepo/tree/master/vsgenstubs

How do I retrieve them?

ChaosKing
2nd August 2020, 16:55
Command is "vsrepo genstubs"
you can add --stub-output-file d:\myfile.txt

lansing
2nd August 2020, 18:49
vsrepo genstubs

The vsgenstub folder doesn't come with the vs installer, I had to manually add it to the vsrepo diretory

python vsrepo.py genstubs --stub-output-file "e:\ns.txt"

This is better than what we can get from core.get_plugins(). It has all the installed functions, all the vs classes/functions/properties, all function arguments' name and type, as well as the return type of the functions.

Myrsloik
2nd August 2020, 18:58
The vsgenstub folder doesn't come with the vs installer, I had to manually add it to the vsrepo diretory

python vsrepo.py genstubs --stub-output-file "e:\ns.txt"

This is better than what we can get from core.get_plugins(). It has all the installed functions, all the vs classes/functions/properties, all function arguments' name and type, as well as the return type of the functions.

I'll include vsgenstubs in the installer for future releases. You may also be interested to know that the V4 API will expose return types of functions and have a much nicer way to enumerate all plugins.

ChaosKing
2nd August 2020, 19:03
I wonder what the difference is between "_Plugin_knlm_Unbound" and "_Plugin_knlm_Bound", both look exactly the same...

EDIT
ok there is a difference. In bound clip: "VideoNode" is missing

Is this for core.xy.Filter(clip) vs clip.xy.Filter() ?

lansing
3rd August 2020, 10:43
New update with a find and replace function, finally.

ChaosKing
3rd August 2020, 11:54
It would be nice if "find next" would highlight the found string. Close does nothing.
And your links in first post is not valid anymore :)

lansing
3rd August 2020, 14:17
It would be nice if "find next" would highlight the found string. Close does nothing.
And your links in first post is not valid anymore :)

The string was highlighted and selected, it is hard to notice because of the theme. I tried to copy some themes from other editor but the process was giving me a headache. Need people with a lot of patient to do these.

Update: oh you're that the find function didn't return the string, will fix

lansing
5th August 2020, 01:36
Update, slowly completing all the ui functions.

changelog:
- Added the basic editor copy/paste actions to the menu options
- Added a copy script to new tab function
- Added right click and middle click signal to the tabwidget
- Added middle click close tab function
- Added menu options to toggle the Tools widget and its dialogs

I added a hook to tab on right click for context menu, but I don't really think there're many things to add to the list beside "close tab" and "copy to new tab".
I added toggle actions to all the Window Dialog, but the cost is that the buttons now only shows icon instead of text.

edison
5th August 2020, 07:39
I tried to run the vsedit.exe (VE2 r1.3 x64), nothing happen.
Windows 10 2004 x64 chs, Core i7 2600K.

lansing
5th August 2020, 09:24
I tried to run the vsedit.exe (VE2 r1.3 x64), nothing happen.
Windows 10 2004 x64 chs, Core i7 2600K.

I don't know. Have you try on another machine?

ChaosKing
5th August 2020, 09:41
In 1.3 the button text dissapeared. Oh and "Tools" could be shifted a bit to the right
https://i.imgur.com/fsFxXZZ.png

Richard1485
5th August 2020, 20:39
This might be a stupid question, but assuming that there will be a Linux version of VSE v2 (as there was with v1), is there any chance that it could be made to double as an editor for AviSynth+?

lansing
5th August 2020, 21:17
This might be a stupid question, but assuming that there will be a Linux version of VSE v2 (as there was with v1), is there any chance that it could be made to double as an editor for AviSynth+?

I have no plan for Avisynth+ support.

lansing
6th August 2020, 10:30
Update, fixed all reported display issues and a couple of bugs. Frame Info dialog is able to show frame properties now. It's like calling text.FrameProps() but with mapped definitions. I don't know if it works on user created properties, I will need feedback on that. The formatting is still ugly, will need time to figure out where everything should go.

changelog:
- Per frame properties can be display in frame info dialog now

Richard1485
6th August 2020, 11:36
I have no plan for Avisynth+ support.

Understood. It was just a thought.:)

ChaosKing
6th August 2020, 12:37
Feature request: Make print() show output in log (or with a different keyword if print is too much work)

Frame props are showed only after I click on a new frame.

I just noticed that I can not use the arrow keys (left right) to navigate in the timeline :scared: I use the arrow keys all the time.

lansing
6th August 2020, 15:32
Feature request: Make print() show output in log (or with a different keyword if print is too much work)


I don't know what you mean.

ChaosKing
6th August 2020, 16:37
A print("Hello") does not output "Hello" in the log window.

Myrsloik
6th August 2020, 16:56
A print("Hello") does not output "Hello" in the log window.

The V4 api branch has core.logMessage() which will appear there. A separate feature may not be necessary.

lansing
6th August 2020, 17:08
A print("Hello") does not output "Hello" in the log window.

Oh this should be simple. Since print() doesn't do anything in vsscript, I can just reuse the keyword. And then on preview call, use regex to capture all the print() in the editor and print them out in the log. But what is the usage for this?

ChaosKing
6th August 2020, 17:53
It is mostly needed for debug purposes often in combination with FrameEval.

Will wait for v4 api then :)

lansing
7th August 2020, 07:28
I'm trying to turn some vs scripts into button calls for preview, my idea is to have the function script import the user script from the editor, and then use the set_output() call in the function script to preview the frame, I came across this post (https://forum.doom9.org/showthread.php?t=175098) that talked about it, but I still couldn't get it to work.

editor script saved as test.py

import vapoursynth as vs
core = vs.core

...
clip.set_output()


function script

import vapoursynth as vs
core = vs.core

main_script = r"E:\test.py"
import main_script
main_clip = vs.get_output()

main_clip.set_output()

But I'm getting the error "ModuleNotFoundError: No module named 'main_script'", what is wrong?

Myrsloik
7th August 2020, 08:11
I'm trying to turn some vs scripts into button calls for preview, my idea is to have the function script import the user script from the editor, and then use the set_output() call in the function script to preview the frame, I came across this post (https://forum.doom9.org/showthread.php?t=175098) that talked about it, but I still couldn't get it to work.

editor script saved as test.py

import vapoursynth as vs
core = vs.core

...
clip.set_output()


function script

import vapoursynth as vs
core = vs.core

main_script = r"E:\test.py"
import main_script
main_clip = vs.get_output()

main_clip.set_output()

But I'm getting the error "ModuleNotFoundError: No module named 'main_script'", what is wrong?

Read the whole script file and pass it to exec() or eval(). That's most likely the easiest way.

lansing
7th August 2020, 16:00
Read the whole script file and pass it to exec() or eval(). That's most likely the easiest way.

I need to pass the clip from one script to another. How do I retrieve the clip with eval()?

l33tmeatwad
7th August 2020, 16:06
Getting the following error compiling on macOS.
../../vsedit/src/script_templates/templates_dialog.cpp:34:37: error: no viable
conversion from 'QVector<vsedit::VariableToken>' to
'std::vector<vsedit::VariableToken>'
std::vector<vsedit::VariableToken> variables =

Myrsloik
7th August 2020, 16:09
I need to pass the clip from one script to another. How do I retrieve the clip with eval()?

I'm no python expert but I think a simple vs.get_output() after exec() should do since the output clip is actually stored inside the vapoursynth module's global state.

lansing
7th August 2020, 17:03
Getting the following error compiling on macOS.
../../vsedit/src/script_templates/templates_dialog.cpp:34:37: error: no viable
conversion from 'QVector<vsedit::VariableToken>' to
'std::vector<vsedit::VariableToken>'
std::vector<vsedit::VariableToken> variables =

I don't know anything about compiling. From the error, maybe your compiler didn't understand Qt library? Is there any other similar error about conversion?

ChaosKing
7th August 2020, 17:07
CTRL+D (duplicate line) does not work in vseditor2, but worked in the orig. editor.

_Al_
7th August 2020, 17:14
But I'm getting the error "ModuleNotFoundError: No module named 'main_script'", what is wrong?
as a python module, main_script.py has to be in the same directory (or in site-packages directory) or you have to append your directory to path:
import sys
sys.path.append(r'path to directory with main_script')
import main_script

EDIT: I just tried it with vsedit, sorry I take that back, saying it is not working,
it works appending that directory to sys.path

l33tmeatwad
7th August 2020, 17:35
I don't know anything about compiling. From the error, maybe your compiler didn't understand Qt library? Is there any other similar error about conversion?Sorry, should have included more details, using clang 11.0.3 in macOS Catalina with Qt 5.12.6 (also tried 5.15.0). I may try on Sierra with Qt 5.6 which was the version of Qt I had to use for a while due to newer versions breaking stuff in some releases of the original vsedit, but they would usually still compile...

Edit: Sierra isn't liking a few of the uses of qDebug and is erroring out sooner...fun!

lansing
7th August 2020, 19:14
I'm no python expert but I think a simple vs.get_output() after exec() should do since the output clip is actually stored inside the vapoursynth module's global state.

I passed in the script text from the editor to eval(), log showing that the script did pasted into eval() but I got the syntax error


eval(import vapoursynth as vs
^
SyntaxError: invalid syntax

l33tmeatwad
7th August 2020, 19:20
Just an update, looks like Ubuntu 20.04 is failing the same as Sierra.
../../common-src/vapoursynth/vapoursynth_script_processor.cpp:959:12: error: invalid use of incomplete type ‘class QDebug’
959 | qDebug() << message;
| ^

lansing
7th August 2020, 19:29
Just an update, looks like Ubuntu 20.04 is failing the same as Sierra.
../../common-src/vapoursynth/vapoursynth_script_processor.cpp:959:12: error: invalid use of incomplete type ‘class QDebug’
959 | qDebug() << message;
| ^

Have you try compiling it inside Qt Creator?

l33tmeatwad
7th August 2020, 19:43
Have you try compiling it inside Qt Creator?Considering it uses the same compiling tools it wouldn't really matter, but to be thorough I went ahead and ran it just to confirm, and it does give the same error...
calling 'debug' with incomplete return type 'QDebug'

lansing
7th August 2020, 23:08
I passed in the script text from the editor to eval(), log showing that the script did pasted into eval() but I got the syntax error


eval(import vapoursynth as vs
^
SyntaxError: invalid syntax


Okay I figured it out, I should be passing the "clip.set_output()" into eval(), not the entire script.


# paste in script from editor
eval("clip.set_output")
new_clip = vs.get_output()
# do stuff
new_clip .set_output()


This IS a lot easier than the import method, no need to save the script to a temporary location and struggle to get the right path just to retrieve it.

_Al_
8th August 2020, 00:14
This IS a lot easier than the import method, no need to save the script to a temporary location and struggle to get the right path just to retrieve it.
Because of using vsedit, that introduces that path problem, otherwise having py in the same dir imports scripts just fine.

lansing
9th August 2020, 06:56
A test build (https://www.dropbox.com/s/ykeunegrr2by0q3/VapourSynthEditor2-r1.5_test-build-64bit.7z?dl=0) here for a new preview filters feature. The idea is to take advantage of vs script and turn some utility functions into button click to assist preview, such as a one click switch between YUV channels (not sure if they're called Y'CrCb or YUV). It is very useful for people doing denoising. Right now it only has one script in the chain, but more can be added. For example the UV channels are very hard to see because of low contrast, to combat this we can chain another "auto contrast" script after it to make it more visible.

I have a few questions though to make sure I didn't mess up. Are they YUV channels or Y'CrCb channel? And what about the planes? I know plane 0 is Y channel, but what is plane 1 and 2?

clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
u_clip = core.std.ShufflePlanes(clip_yuv16, planes=1, colorfamily=vs.GRAY)


And right now I am reading the script right from the text files and it needs to be in the folder to work. How do I store the text content inside a c++ file instead?

lansing
9th August 2020, 18:36
I found a memory leak that was dated from the original version. If you load a script->preview->close->preview->close, the memory will slowly goes up by 10MB without dropping. It wasn't noticeable until the use of preview filters, where you'll do preview-close actions much more often. Is there a proper method to track down the leak? Because I was looking all over the place and it's going to take a very long time.

quietvoid
10th August 2020, 00:34
As far as I know, it's the behavior of all the vsscript previewers. The memory usage goes up to the max cache size, if it was set in the script. Otherwise it feels like there is no garbage collection in VS, and everything is cached indefinitely.

_Al_
10th August 2020, 06:37
plane 1 and 2yes plane 1 is U as in your example,
plane 2 is V if clip is YUV. If RGB, then same order R,G,B as 0,1,2 as well.
And right now I am reading the script right from the text files and it needs to be in the folder to work. How do I store the text content inside a c++ file instead?
Not sure exactly what it suppose to be, but if in Python, you can import a module (a script in our case) right from text (a string type) or built in text editor for example and then using it because it is imported. So if coding in Python that handles some text editor, it can run that script from within. Script does not have to be physically on disc or a directory/folder. Not sure how it should be implemented to C++ or if it is possible. In Python you can do:

import vapoursynth as main_vs
import importlib.util
script = 'import vapoursynth as vs\nclip=vs.core.std.BlankClip()\nclip.set_output()' #you fetch this from text editor etc.
main_vs.clear_outputs()
spec = importlib.util.spec_from_loader('my_module_name', loader=None)
vs_module = importlib.util.module_from_spec(spec)
exec(script, vs_module.__dict__)

imported_clip = main_vs.get_output()
imported_clip.set_output()

so basically, you import that created module from text and having that clip available within code where you created that text.
Again not sure how to make it work as coding in C++. You'd need to have some master script in Python all the time and load all other scripts in it. But that's weird.

lansing
10th August 2020, 11:30
Update to r1.5

changelog:
- A new preview filters feature leveraging vs script to assist preview
- Preview filters can be chained

All problem solved, now the preview filters feature should be fully functional and no script needs to be loaded at runtime. The program will read the "xyz.set_output()" from the script in the editor and append the preview filters to it. The combined script will be run to produce the filtered effect.

Right now I have added the YUV channel split script to display YUV channel separately, well I'm not sure what the correct term for it, YUV or Y'CbCr? And are they called plane or channel or component?
I'll add more in the future if I found them useful.

ChaosKing
10th August 2020, 12:37
I get this error SyntaxError: invalid syntax -> clip.set_output()eval("clip.set_output()") if I click on Y in [PF]. Clicking on off does not seem to turn it off, the error msg is still shown.

My script
clip = core.lsmas.LWLibavSource(source=r"E:\ep1_1.vob")
clip.set_output()

lansing
10th August 2020, 14:21
I get this error SyntaxError: invalid syntax -> clip.set_output()eval("clip.set_output()") if I click on Y in [PF]. Clicking on off does not seem to turn it off, the error msg is still shown.

My script
clip = core.lsmas.LWLibavSource(source=r"E:\ep1_1.vob")
clip.set_output()
That because there's no new line between the set_output and eval function. Just put a new line after set_output for now. I'll fix it in next version.

lansing
10th August 2020, 16:31
As far as I know, it's the behavior of all the vsscript previewers. The memory usage goes up to the max cache size, if it was set in the script. Otherwise it feels like there is no garbage collection in VS, and everything is cached indefinitely.

um...looks like the leak can be traced back 7 years ago:
https://github.com/dubhater/vapoursynth-viewer


Notes
Something leaks, maybe 1 megabyte every time a script is (re)loaded.


Now it's 10 MB instead of 1 for every reload. I'll report it.

lansing
10th August 2020, 22:21
r1.6 up, fixed all reported issues

changelog:
- Fixed preview filters dialog Cr Cb button swap
- Fixed preview filter script wrong appending
- Arrow key navigation from time line and preview area works now
- Fixed all editor shortcut keys

ChaosKing
10th August 2020, 23:43
Thx!
I noticed that after switching multiple times between Off Y Cb Cr it kinda breaks. It does not work anymore but there is no error msg. I can scroll but the image does not change. Its like no script is loaded anymore.
I found it very usefull already.

Edit
Can we get right click on tab and close?

lansing
11th August 2020, 00:06
Thx!
I noticed that after switching multiple times between Off Y Cb Cr it kinda breaks. It does not work anymore but there is no error msg.
It's probably from the vs memory leak. It will leak a little every time you run preview script, which is what switching between YCbCr planes is doing. I just tested it, I spammed the buttons until around 1.5G ram and the program crashed.


Can we get right click on tab and close?

You can close with middle click. I'll add it to right click just for the sake of it.

fAy01
11th August 2020, 00:40
1 - Is it possible to add short cut keys to switch between tabs and/or use the mouse scroll button? (Feature available in Avspmod2. Tabs can be accessed with ctrl+1, ctrl+2 and so on. Same with the mouse scroll button).
2 - Double clicking the video region to maximize the window and enter full screen for comparison between two sources. (Feature available in Avspmod2).
3 - At the moment the script window can only be positioned on the left hand side. Is it possible to have it at the top, bottom, and/or right? Or have the option to hide it similar to the script evaluation window in the script window.
4 - Could the bookmark feature be used to generate chapters (txt or xml) with custom configurable presets for chapter names? E.g. Preset 1 [OP, Main, ED, Preview], Preset 2 [Prologue, Opening, Part A, Eyecatch, Part B, Ending, Preview]
5 - Using the bookmarked frames to generate a qpfile for x264?
6 - A place to dock/undock Bookmark Manager.

Kind Regards!

lansing
11th August 2020, 02:11
1 - Is it possible to add short cut keys to switch between tabs and/or use the mouse scroll button? (Feature available in Avspmod2. Tabs can be accessed with ctrl+1, ctrl+2 and so on. Same with the mouse scroll button).
Yeah I'll add those shortcuts, I have been told to use the number button for switching.

2 - Double clicking the video region to maximize the window and enter full screen for comparison between two sources. (Feature available in Avspmod2).

I will have to think about that.

3 - At the moment the script window can only be positioned on the left hand side. Is it possible to have it at the top, bottom, and/or right? Or have the option to hide it similar to the script evaluation window in the script window.

I'm not changing the layout because I think this is the most suitable layout for video script editor. Every space in the ui have served a purpose with minimum waste. Positioning the script window to the top or bottom is a terrible design. Just look at Avspmod, maximize its window and you'll have more than half of your screen filled with empty white space.

I can make it closable and be restored from the Window menu but that's about it

4 - Could the bookmark feature be used to generate chapters (txt or xml) with custom configurable presets for chapter names? E.g. Preset 1 [OP, Main, ED, Preview], Preset 2 [Prologue, Opening, Part A, Eyecatch, Part B, Ending, Preview]
The bookmark manager can generate chapter text file from bookmarked frame with chaptername and that's the farthest I would go. You'll have to use some better chapter specific programs for those features.

5 - Using the bookmarked frames to generate a qpfile for x264?
6 - A place to dock/undock Bookmark Manager.

I don't know what qpfile is and there's no more room to dock the bookmark manager.

fAy01
11th August 2020, 09:27
I don't know what qpfile is and there's no more room to dock the bookmark manager.

qpfile is a text/txt file with a list of I frames for chapter creation. Following is an example:
0 I -1
2158 I -1
16688 I -1
17084 I -1
30331 I -1
32490 I -1

Make the bookmark manager window dock with the script window. Similar to the tab implementation.

feisty2
11th August 2020, 10:49
I wonder if it's possible to write plugins for vseditor (not vaporsynth)
certain tasks like mask drawing could really benefit from GUI and it's painful to write a standalone GUI application for these things.
Ideally, a vseditor filter should accept a video clip and a set of coordinates (spatial coordinates x, y and temporal coordinate t).
the user opens the "preview" window and clicks around and vsedit automatically generates an array containing the coordinates selected by the user, and the user can then pass the array to a vseditor filter.

lansing
11th August 2020, 15:38
I wonder if it's possible to write plugins for vseditor (not vaporsynth)
certain tasks like mask drawing could really benefit from GUI and it's painful to write a standalone GUI application for these things.
Ideally, a vseditor filter should accept a video clip and a set of coordinates (spatial coordinates x, y and temporal coordinate t).
the user opens the "preview" window and clicks around and vsedit automatically generates an array containing the coordinates selected by the user, and the user can then pass the array to a vseditor filter.

You'll have to show some sample image about the concept because I don't know what mask drawing is. What do you mean by "opens the "preview" window and clicks around", what is supposed to be in the window?

I was also thinking about adding plugin support like virtualdub, for 3rd party plugin to be able to write plugin for vapoursynth while at the same time be able to use vseditor as a frame source for their own gui. But I still don't know how this can be tied back to the script.

feisty2
11th August 2020, 16:12
mask drawing is something like manual image matting, the user selects an area of the image by drawing a closed curve and it creates a mask that separates what's inside the curve and what's outside the curve, you can apply different filters to each part then assemble them using std.MaskedMerge, what it creates is the "mask" argument of std.MaskedMerge.

suppose there's this mask drawing filter Matte(clip, trace), where "trace" is a list of control point coordinates sampled from the closed curve drawn by the user, for a 100x50 rectangular region with its top-left corner located at (0,0), "trace" should be [[0,0], [0,100],[50,0],[50,100]], the user should be able to open the preview window and click a "select mode" button or whatever, then click the pixels at (0,0), (0,100), (50,0), (50,100), and vsedit should automatically print something like "ctrl_points = [[0,0], [0,100],[50,0],[50,100]]" in the script, then the user can create the mask by calling "Matte(clip, trace = ctrl_points)"

feisty2
11th August 2020, 16:26
basically, this is what I'm talking about
https://i.imgur.com/dU6bpgb.png

poisondeathray
11th August 2020, 16:46
Masks would be a great feature!

It runs on QT, right ? Something like this integrated? Is it possible ?
https://doc.qt.io/qt-5/qpainter.html

lansing
11th August 2020, 16:59
basically, this is what I'm talking about


Okay this should be simple to implement but what is the use for this? Doesn't rectangle mask like this only work for one frame?

feisty2
11th August 2020, 17:11
it is useful for some very careful frame-by-frame video restoration, and sometimes you only need to select a static region across all frames, like the LogoAnalysis virtualdub plugin.

lansing
11th August 2020, 19:50
it is useful for some very careful frame-by-frame video restoration, and sometimes you only need to select a static region across all frames, like the LogoAnalysis virtualdub plugin.

Okay after looking through more similar tools, I think I get the idea. What you're looking for is a marquees(select) tool like from photoshop. And in this case you're specifically looking for the rectangle marquees tool and have it return the selection as in control points.

For now I'll add the rectangle select tool and the lazy rectangle select tool like in Windows Paint and see how it goes.

ChaosKing
11th August 2020, 20:33
It's probably from the vs memory leak. It will leak a little every time you run preview script, which is what switching between YCbCr planes is doing. I just tested it, I spammed the buttons until around 1.5G ram and the program crashed.


Could maybe this next() + del strategy solve this issue?
https://forum.doom9.org/showthread.php?p=1920780#post1920780

lansing
11th August 2020, 21:09
Could maybe this next() + del strategy solve this issue?
https://forum.doom9.org/showthread.php?p=1920780#post1920780

See here,
https://forum.doom9.org/showthread.php?p=1920641#post1920641

Update, here's the log from vseditor after I closed the tab
Core freed but 537600 bytes still allocated in framebuffers

I'll see if there's function in the vsapi to free those buffers.

lansing
11th August 2020, 21:19
qpfile is a text/txt file with a list of I frames for chapter creation. Following is an example:
0 I -1
2158 I -1
16688 I -1
17084 I -1
30331 I -1
32490 I -1

This can be set in the delimiter in the setting. I'll make it to read "new line" symbol and it should be good.


Make the bookmark manager window dock with the script window. Similar to the tab implementation.
There is no room, the log window is already under the script window.

l33tmeatwad
11th August 2020, 23:15
Took some time today to try and add in missing includes to try and get to compiled on Ubuntu, ran into an issue this this:
bool ScriptEditor::slotFind(const QString &a_text, const QTextDocument::FindFlags &a_flags, bool a_useRegEx)
{
QTextCursor cursor;
if (a_useRegEx == true) {
QRegularExpression re(a_text);
return find(re);
} else {
return find(a_text, a_flags);
}
}
What exactly is "find()", it's not declared, if it's a standard fuction or something it probably needs to to be defined manually to work on other platforms, looks like Windows is VERY forgiving for leaving out includes.

lansing
11th August 2020, 23:31
Took some time today to try and add in missing includes to try and get to compiled on Ubuntu, ran into an issue this this:

What exactly is "find()", it's not declared, if it's a standard fuction or something it probably needs to to be defined manually to work on other platforms, looks like Windows is VERY forgiving for leaving out includes.

The find() is from Qt's QPlainTextEdit class, which is what my class was extended from.

l33tmeatwad
11th August 2020, 23:36
The find() is from Qt's QPlainTextEdit class, which is what my class was extended from.
Hmm...odd, still getting the following error on compile:
../../vsedit/src/script_editor/script_editor.cpp:582:23: error: no matching function for call to ‘ScriptEditor::find(QRegularExpression&)’
582 | return find(re);

lansing
11th August 2020, 23:54
Hmm...odd, still getting the following error on compile:
../../vsedit/src/script_editor/script_editor.cpp:582:23: error: no matching function for call to ‘ScriptEditor::find(QRegularExpression&)’
582 | return find(re);

Maybe your Qt version is older than Qt 5.13? That's when this overloaded function was introduced.

l33tmeatwad
12th August 2020, 00:16
Maybe your Qt version is older than Qt 5.13? That's when this overloaded function was introduced.That would be why, Ubuntu 20 uses Qt 5.12 (LTS). Looks like I won't be able to recommend this until probably the next round of LTS Linux releases. Now as for compiling with Qt 5.13+, the issue I mentioned before keeps it from compiling on macOS:
../../vsedit/src/script_templates/templates_dialog.cpp:34:37: error: no viable conversion from
'QVector<vsedit::VariableToken>' to 'std::vector<vsedit::VariableToken>'
std::vector<vsedit::VariableToken> variables =
I'm not sure why this is happening as the code there is the same as r19 of the original vsedit, so something in the pipeline that changed is probably causing that error. Not sure why it's happening on macOS and not in Windows, I haven't tried on Linux yet as setting up Qt newer than the distributed packages is kinda annoying.

lansing
12th August 2020, 02:17
That would be why, Ubuntu 20 uses Qt 5.12 (LTS). Looks like I won't be able to recommend this until probably the next round of LTS Linux releases. Now as for compiling with Qt 5.13+, the issue I mentioned before keeps it from compiling on macOS:
../../vsedit/src/script_templates/templates_dialog.cpp:34:37: error: no viable conversion from
'QVector<vsedit::VariableToken>' to 'std::vector<vsedit::VariableToken>'
std::vector<vsedit::VariableToken> variables =
I'm not sure why this is happening as the code there is the same as r19 of the original vsedit, so something in the pipeline that changed is probably causing that error. Not sure why it's happening on macOS and not in Windows, I haven't tried on Linux yet as setting up Qt newer than the distributed packages is kinda annoying.

There's a QVector container class in the lines, so maybe it's the same reason as the other one. I'm using Qt 5.14.2.

l33tmeatwad
12th August 2020, 02:46
There's a QVector container class in the lines, so maybe it's the same reason as the other one. I'm using Qt 5.14.2.
Using 5.13+ fixed the other issue, so this is probably not related. I tried 5.13, 5.14, & 5.15.

fAy01
12th August 2020, 03:42
There is no room, the log window is already under the script window.

It's been done in wobbly.

https://i.imgur.com/66Q2bIS.png

https://i.imgur.com/BiWMtuj.png

lansing
12th August 2020, 04:06
It's been done in wobbly.


I'm not sacrificing the space of the two main components for a tool window.

lansing
12th August 2020, 05:31
R2 released.

changelog:

r2: [2020-08-12]
- Disabled mouse scroll to scroll a zommed preview because it doesn't make sense to be only able to scroll one axis
- Preview zoom in scroll bar position are remembered for similar clips in a group
- Fixed preview zoom raito not having immediate effect when change tabs
- Script window can be hidden and restore now
- Added close tab action when right click on tab
- Added shortcuts to switch tab by number keys, available keys are 1-9
- Fixed all editor shortcut keys
- Arrow key navigation from time line and preview area works now
- A new preview filters feature leveraging vs script to assist preview
- Preview filters can be chained
- Per frame properties can be display in frame info dialog now
- Added menu options to toggle the Tools widget and its dialogs
- Added a copy script to new tab function
- Added right click and middle click signal to the tabwidget
- Added middle click close tab function
- Added the basic editor copy/paste actions to the menu options
- A find and replace function for the editor
- PreviewArea now uses QPainter for frame drawing instead of QPixmap, which greatly improves performance for zooming
- Zoom ratio cap increases to 25x

poisondeathray
12th August 2020, 05:57
Thanks for the update

typo for tab name is "untitiled" instead of untitled



- Added shortcuts to switch tab by number keys, available keys are 1-9

I can't get this to work. Is it activated yet ?

lansing
12th August 2020, 06:15
Thanks for the update

typo for tab name is "untitiled" instead of untitled

I can't get this to work. Is it activated yet ?
Have you try it with more than one tab?

poisondeathray
12th August 2020, 06:22
Have you try it with more than one tab?

:) yes , of course


In the bookmark manager, when you push add, is it supposed to be current frame (where playhead is) ? It seems like wrong frame number. Ctrl+b does not work for me either.

lansing
12th August 2020, 06:29
:) yes , of course


In the bookmark manager, when you push add, is it supposed to be current frame (where playhead is) ? It seems like wrong frame number. Ctrl+b does not work for me either.

Are you running R2? No hotkey for bookmark yet.

poisondeathray
12th August 2020, 06:53
Yes R2

Tabs with number key switching works for you?


feature suggestion - extension templates. In avspmod when you drag some video , it will fill in the source filter, path, everything, you just need to hit preview. You can fill in a preferential source filter file for extensions e.g. LSmashVideoSource(***) for MP4 . Currently the r'PATH\video.ext' is filled when you drag a video

lansing
12th August 2020, 07:12
Yes R2

Tabs with number key switching works for you?


feature suggestion - extension templates. In avspmod when you drag some video , it will fill in the source filter, path, everything, you just need to hit preview. You can fill in a preferential source filter file for extensions e.g. LSmashVideoSource(***) for MP4 . Currently the r'PATH\video.ext' is filled when you drag a video

It works for me, I'll test on another machine tomorrow to see how it goes.

The file drop template feature is already there, go to edit->snippet and templates->file drop templates. That why I didn't go into this area. It's just that nobody know how to use it beside Mystery Keeper lol. I have no clue how it work either.

poisondeathray
12th August 2020, 15:24
It works for me, I'll test on another machine tomorrow to see how it goes.


Thanks, this was on a Win8.1 x64 machine

Number key switching for tabs works on VapourSynthMultiViewer for me (but it's buggy in other ways)


The file drop template feature is already there, go to edit->snippet and templates->file drop templates. That why I didn't go into this area. It's just that nobody know how to use it beside Mystery Keeper lol. I have no clue how it work either.

I didn't even look there! Some examples or guide from MK would be nice but I'll try to figure it out

l33tmeatwad
12th August 2020, 15:29
I was going to make the appropriate changes and push a pull request but this is more than I have time for. It's obvious it needs a major overhaul as the code is completely broken on non-Windows platforms. I'd recommend spinning up a Linux VM to work through fixing things if you care about this being cross platform at all, if not I suppose it's fine as a Windows only tool. Side note, I'd recommend actually adding version tags to the repository so that's its easier to use git to find certain versions to help troubleshoot in the future so that specific commits don't have to be tracked down based on the date you uploaded the executables.

lansing
12th August 2020, 16:14
Thanks, this was on a Win8.1 x64 machine

Number key switching for tabs works on VapourSynthMultiViewer for me (but it's buggy in other ways)
I just tested on my Windows 7 machine, the hotkeys work.

ChaosKing
12th August 2020, 16:16
1,2,3 hotkeys do not work for me. I'm on win10 x64

EDIT
It seems the old config needs to be deleted, then it works.

lansing
12th August 2020, 16:26
I was going to make the appropriate changes and push a pull request but this is more than I have time for. It's obvious it needs a major overhaul as the code is completely broken on non-Windows platforms. I'd recommend spinning up a Linux VM to work through fixing things if you care about this being cross platform at all, if not I suppose it's fine as a Windows only tool. Side note, I'd recommend actually adding version tags to the repository so that's its easier to use git to find certain versions to help troubleshoot in the future so that specific commits don't have to be tracked down based on the date you uploaded the executables.

I'll look into Linux support after finish working on the current feature. What VM software and Linux system do I need?

l33tmeatwad
12th August 2020, 16:28
I'll look into Linux support after finish working on the current feature. What VM software and Linux system do I need?I'll send you a PM with more details.

lansing
12th August 2020, 16:31
1,2,3 hotkeys do not work for me. I'm on win10 x64

EDIT
It seems the old config needs to be deleted, then it works.

Hotkey 1,2 and 3 were used for switching between zoom modes in the original version.

poisondeathray
12th August 2020, 16:42
1,2,3 hotkeys do not work for me. I'm on win10 x64

EDIT
It seems the old config needs to be deleted, then it works.


Can you walk me through how to delete the old config ? I deleted the doubled up 1,2,3 entries in the hotkey mapping for zoom, still does not work for me

Thanks


@lansing -

"new script template" is not active in this version. edit > snippets and templates > new script template . In the original version, CTRL+N opens a new script with the contents of the template pasted ("'import vapoursynth as vs, etc..."

Is "time step foward/back" active? The hotkey ctrl+right / ctrl+left moves 1 frame, but I cannot find the field where you adjust the time period (e.g. 1 second or whatever period)



EDIT: NM CK, I got it working. I needed to exit and restart , HOTKEY TAB SWITCHING WORKS!! THANKS LANSING! This was my #1 request

lansing
12th August 2020, 17:07
"new script template" is not active in this version. edit > snippets and templates > new script template . In the original version, CTRL+N opens a new script with the contents of the template pasted ("'import vapoursynth as vs, etc..."

Is "time step foward/back" active? The hotkey ctrl+right / ctrl+left moves 1 frame, but I cannot find the field where you adjust the time period (e.g. 1 second or whatever period)

I haven't test template much. the "new script template" probably got commented out while testing. I'll fix this area altogether later. I'm going to extract their configs to separate text files like with themes because it's so dangerous right now to jam everything into one config file. It pissed me off the last time when I deleted the config file for reset and lost all my snippets.

The time step has also been disabled for now.

poisondeathray
12th August 2020, 17:12
Where are the config, snippets, user preferences , etc... for vsedit settings saved to on Windows ? AppData/Local or something ? I can't find it

ChaosKing
12th August 2020, 17:22
It is in C:\Users\USERNAME\AppData\Local\vsedit.config
Most programs have their own folder, vsedit does not have one.

Or just type %LOCALAPPDATA% in explorer and scroll to the bottom.

poisondeathray
12th August 2020, 17:25
It is in C:\Users\USERNAME\AppData\Local\vsedit.config
Most programs have their own folder, vsedit does not have one.

Same for me , thanks

lansing
15th August 2020, 05:08
it is useful for some very careful frame-by-frame video restoration, and sometimes you only need to select a static region across all frames, like the LogoAnalysis virtualdub plugin.

feisty2, what should be the output format of the selection rectangle? There are the starting position + width + height, or the four points of the rectangle. What do you need?


(10, 0), width=30, height=20

or

(10, 0) (30, 0) (10,20) (30, 20)

_Al_
15th August 2020, 07:24
vapoursynth uses: width, height, left, top for rectangle
numpy uses: img[y1:y2, x1:x2] for rectangle

feisty2
15th August 2020, 07:52
feisty2, what should be the output format of the selection rectangle? There are the starting position + width + height, or the four points of the rectangle. What do you need?


(10, 0), width=30, height=20

or

(10, 0) (30, 0) (10,20) (30, 20)


the 4 points (actually you only need 2 for rectangular selection, the top left and the bottom right) would be better.

lansing
17th August 2020, 06:56
New version up, now with a new selection tool window to select a part of the frame and return its control points. The returned format is "min_x, min_y, max_x, max_y". Mouse scroll to zoom in and out.

This took me a few tries before finally getting it to work. Zoom will get less responsive as the image gets bigger, most of the time had been spent searching for workaround on this but then I realized that this also happened to photoshop, lol.

_Al_
17th August 2020, 16:34
Zoom will get less responsive as the image gets bigger
This was a major reason to look for some other preview so images after zoom are fast or even behave faster , investigating HD, UHD images on a regular machine even laptops, not having beefed up PC with tons of RAM. This does not increase RAM at all or CPU usage. Using zoom 2x,..., 10x to compare clips. The way is to store three lists with clips:
-original clips passed to viewer (for seeking original values YUV),
-converted rgb clips with original resolution and
-current rgb clips , zoomed etc.
Current rgb clips are those to preview on screen. Every zoom, crop is actually done in absolute scale (https://github.com/UniversalAl/view/blob/master/view.py#L1552) from converted rgb clip from original. This can be done really easy, once you realize that you just need to keep reference data for zooming,cropping (width, height, x(left), y(top) and if zooming from already zoomed image you just add x,y relative coordinates to absolute x,y and do a new zoom from original. This way you can return back to previous zoom (https://github.com/UniversalAl/view/blob/master/view.py#L1516) or just reset image to original (https://github.com/UniversalAl/view/blob/master/view.py#L1569), all pressing a single button.

It looks harsh at first , for example loading 5 clips and zooming in a clip actaully zooms in all remaining rgb clips to same zoom/crop , so clip comparisons is always ready using hot keys, but it is fast because those frames are actually not requested yet, only frames for that actually previewing clip is requested.

lansing
17th August 2020, 17:46
This was a major reason to look for some other preview so images after zoom are fast or even behave faster , investigating HD, UHD images on a regular machine even laptops, not having beefed up PC with tons of RAM. This does not increase RAM at all or CPU usage. Using zoom 2x,..., 10x to compare clips. The way is to store three lists with clips:
-original clips passed to viewer (for seeking original values YUV),
-converted rgb clips with original resolution and
-current rgb clips , zoomed etc.
Current rgb clips are those to preview on screen. Every zoom, crop is actually done in absolute scale (https://github.com/UniversalAl/view/blob/master/view.py#L1552) from converted rgb clip from original. This can be done really easy, once you realize that you just need to keep reference data for zooming,cropping (width, height, x(left), y(top) and if zooming from already zoomed image you just add x,y relative coordinates to absolute x,y and do a new zoom from original. This way you can return back to previous zoom (https://github.com/UniversalAl/view/blob/master/view.py#L1516) or just reset image to original (https://github.com/UniversalAl/view/blob/master/view.py#L1569), all pressing a single button.

It looks harsh at first , for example loading 5 clips and zooming in a clip actaully zooms in all remaining rgb clips to same zoom/crop , so clip comparisons is always ready using hot keys, but it is fast because those frames are actually not requested yet, only frames for that actually previewing clip is requested.

There are more technical things to consider for drawing lines on the image than just zooming. In Qt, in order to draw something, you have to take a pixmap(image) and draw on top of that. Usually we just make a copy of the input image and treated it as the drawing board.

And since lines became part of the image, if you scale the image, the lines will get bigger and become ugly. To prevent this, the process order has to be scale-->draw, not draw-->scale. And this is where it couldn't get optimize, the whole scaled image has to be presented first before the drawing.

Looking at the wider picture, if even Photoshop is having this same problem, there's nothing more I can do about it.

_Al_
17th August 2020, 18:13
In Qt, in order to draw something, you have to take a pixmap(image) and draw on top of that.
opencv works the same , there is no overlay or something (or I cannot use it), lines are one pixel wide and they become thick if zoomed in enough.
But that has nothing to do with that zoom in strategy. I attempted to do it like that in Qt as well. But using QThread for creating a pixmap and also QTimer to time it, it became difficult to apply it (for more clips). I was thinking to start a QThread with all rgb clips loaded but it looked difficult I gave up, also having working an alternative. But you guys are better programmers. Mystery Keeper might have started it with a mind to preview one clip only. You start something else, based on that code, so things might need some regrouping.

Also, those crop lines are added into image just before previewing (whatever it is opencv, Ot, draw into numpy image (https://github.com/UniversalAl/view/blob/master/view.py#L970) or just before creating a pixmap in Qt), they are not part of those rgb arrays.

Also, that line could be one pixel thick, it does not matter, because it has no meaning to be smaller, smaller than a pixel in video.

So draw (into whatever on screen) -->scale (new rgb --> for pixmap) is fine, not sure why to avoid it?

Looking at Qt codes now. I cannot find a process of Qt upscaling automatically to preview window size (point resize) , so that might be done manually controlling aspect ratio as well. This is done automatically in opencv, hence zooming in is faster, because reference w x h gets smaller. This is the core of the problem? This should not be done with Bicubic resize etc., preview would be not real.

lansing
18th August 2020, 03:14
opencv works the same , there is no overlay or something (or I cannot use it), lines are one pixel wide and they become thick if zoomed in enough.
But that has nothing to do with that zoom in strategy. I attempted to do it like that in Qt as well. But using QThread for creating a pixmap and also QTimer to time it, it became difficult to apply it (for more clips). I was thinking to start a QThread with all rgb clips loaded but it looked difficult I gave up, also having working an alternative. But you guys are better programmers. Mystery Keeper might have started it with a mind to preview one clip only. You start something else, based on that code, so things might need some regrouping.

Also, those crop lines are added into image just before previewing (whatever it is opencv, Ot, draw into numpy image (https://github.com/UniversalAl/view/blob/master/view.py#L970) or just before creating a pixmap in Qt), they are not part of those rgb arrays.

Also, that line could be one pixel thick, it does not matter, because it has no meaning to be smaller, smaller than a pixel in video.

So draw (into whatever on screen) -->scale (new rgb --> for pixmap) is fine, not sure why to avoid it?

Looking at Qt codes now. I cannot find a process of Qt upscaling automatically to preview window size (point resize) , so that might be done manually controlling aspect ratio as well. This is done automatically in opencv, hence zooming in is faster, because reference w x h gets smaller. This is the core of the problem? This should not be done with Bicubic resize etc., preview would be not real.

Zooming is not cropping, I think this is where you have fundamentally mistaken it. The image needs to be able to move around while zoomed in, therefore it cannot be cropped, the whole scaled image has to be there first. And then limitation occurs as the image gets bigger.

_Al_
18th August 2020, 04:49
Yes, it is not the same. It is a decision to make it the same. You are always one key press away to return to previous zoom (to zoom out to previous zoom) as described above or reset (whole resolution). That brings in video world instant advantage to handle things on slow PC's , or not enough RAM (which 8GB easily is) even if manipulating with UHD. It is the same handling as in every NLE. Left hand is on keyboard, right on the mouse.

lansing
23rd August 2020, 17:12
I didn't even look there! Some examples or guide from MK would be nice but I'll try to figure it out

Do you manage to figure out how the drop template works?

poisondeathray
23rd August 2020, 17:19
Do you manage to figure out how the drop template works?

Not yet; busy with other stuff

I have time to play with it today , and will post details if I figure it out

poisondeathray
23rd August 2020, 17:48
Do you manage to figure out how the drop template works?


I got it figured out. Don't forget to push "save all" to commit changes. I didn't need to exit/restart the program


"category" is just description for user

"file name mask list" is the actual wild card entry such as "*.mkv" (without the quotes)

When you click on the row, enter what you want in the text box below, with tokens. All that I needed in Windows for tokens was {f}, it filled in the extension, filename


clip = core.lsmas.LWLibavSource(r'{f}')



For example, I like using "LibavSMASHSource" for MP4 (no indexing)

So I would make an entry for category = mp4
filename mask list = *.mp4
and clicking on the row I would enter:

clip = core.lsmas.LibavSMASHSource(r'{f}')

It fills in everything including clip = core.lsmash.LibavSMASHSource(r'PATH\NAME.mp4)

If you don't like using clip = whatever, you can change it

It's pretty easy to figure out, if someone needs screenshots or more help just ask

lansing
23rd August 2020, 18:49
Thanks I got it working. I was using ".mp4" for the wildcard and it didn't work. I didn't know that we have to put a * in front.

lansing
28th August 2020, 21:59
Updated version to R3. Many code refactoring and clean up while waiting for VSAPI 4.0. And fixed a bug where the frame cache didn't get release on tab close.

changelog

R3: [2020-08-28]
- Fixed a bug where frame cache didn't get released when tab was closed
- Added a button in settings to open the config file folder
- Fixed missing includes in repo so the project can be rebuild by others
- A new selection tool to make area selection on a single frame. The selected rectangle can be returned with its control points (coordinates)
- Finished transferring the frame discarded rollback function
- Cosmetic adjustment for timeline and bookmark manager
- Refactored codes and cleaned up some obsolete codes


I tried to look for the memory leak in vapoursynth but still don't know where it is. I narrowed the problem down to the creation of a VSCore. Every time I created a vscore and deleted it, some 9MB of RAM leaked.

VSCore *pCore = cpVSAPI->createCore(1);
cpVSAPI->freeCore(pCore);


While at it, I found another memory hogging problem on playback. If we set play speed to anything other than "no limit", memory usage will be doubled. For my dvd, the memory usage playing with "no limit" is 150 MB while playing it without "no limit" jumped to 300 MB. I'm still investigating the problem and looking from the change log, I'm suspecting that it could be originated all the way back from r9 of the original version.

However I couldn't find download for r8 anymore, MS's page only has r17 as the oldest release. If anyone has the older version, please share it.

ChaosKing
28th August 2020, 23:20
You got lucky https://web.archive.org/web/20160604054704/https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads/

Direct link https://web.archive.org/web/20160607212315/https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads/VapourSynthEditor-r8-64bit.7z

lansing
29th August 2020, 00:16
You got lucky https://web.archive.org/web/20160604054704/https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads/

Direct link https://web.archive.org/web/20160607212315/https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads/VapourSynthEditor-r8-64bit.7z

Oh no, the playback feature wasn't implemented in r8 yet, need to look for r9 now.

Update: I was able to rebuild r9 from source.

In r9, RAM usage will only go double on playback and go back down when stopped. So this mechanism was broken somewhere in between the updates in the years. Right now the RAM will not go back down when stopped. Will fix.

l33tmeatwad
30th August 2020, 02:11
Took me a while to get around to compiling and testing this. One thing I don't like is the fact that you cannot load videos without the full path added even if the script is in the same folder. Was this an intentional change?

lansing
30th August 2020, 04:53
Took me a while to get around to compiling and testing this. One thing I don't like is the fact that you cannot load videos without the full path added even if the script is in the same folder. Was this an intentional change?

I never knew it was there lol, I always load video by drag and drop. I'll look into it.

Cary Knoop
30th August 2020, 04:59
Question about this new VS Editor, can I install this without negatively impacting the original VS Editor, in other words can both be installed and used?

poisondeathray
30th August 2020, 05:31
Question about this new VS Editor, can I install this without negatively impacting the original VS Editor, in other words can both be installed and used?

Yes, no problem

But they share the same config file. If you edit the preferences on one, it affects the other

In Windows:
It is in C:\Users\USERNAME\AppData\Local\vsedit.config
Most programs have their own folder, vsedit does not have one.

ChaosKing
30th August 2020, 06:16
Yes, no problem

But they share the same config file. If you edit the preferences on one, it affects the other

In Windows:

There is also a portable mode! You can find it in settings.

lansing
30th August 2020, 10:38
In r9, RAM usage will only go double on playback and go back down when stopped. So this mechanism was broken somewhere in between the updates in the years. Right now the RAM will not go back down when stopped. Will fix.

More update on this, this looks to be a lot bigger issue than I thought. The RAM usage came from the frame cache. The program is caching two copies of a frame at a time. One copy would be convert to RGB for preview and the other copy for process like running benchmark and retrieving frame info. This led to unnecessary doubling of RAM usage during preview playback. As a result, a supposedly 600 MB of frame cache for a 1080 video was doubled to 1600 MB.

In comparison, the same 1080 video on Avspmod only uses 270 MB of RAM...there's a lot of improvement to be done...

ChaosKing
31st August 2020, 07:37
So that is why after a while + multiple previews vsedit just chrashed for me.

lansing
31st August 2020, 23:17
I put up a R3.1 test build (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/) for testing. This probably breaks benchmark and encoding.

This build I removed one of the frame copy in the frame cache, that only saved about 10% of memory usage. What really reduced the memory are changing the frame requesting queue from using max number of threads to 2 and setting frame cache from 100 to 1. The result is:

720 x 480:
before: 310 MB
after: 120 MB

1920 x 1080:
before: 1600 MB
after: 476 MB


From my observation I don't see any negative impact but I have a fast machine, so please test on your machine and give feedback on the change.

poisondeathray
1st September 2020, 05:22
R3.1 test seems ok so far. But you're right - benchmark crashes it

lansing
1st September 2020, 06:44
R3.1 test seems ok so far. But you're right - benchmark crashes it

What is your RAM usage on playback compare to R3?

poisondeathray
1st September 2020, 16:13
What is your RAM usage on playback compare to R3?


1280x720p23.976

R3 634 MB

R3.1 149 MB

V1 R19 636 MB

poisondeathray
1st September 2020, 16:15
request:
1) ability to drag tabs to reorder them
2) can you add right click > copy to to new tab in the tab context menu ?

shph
1st September 2020, 17:28
request for mouse middle click to zoom (similar to "classic" vseditor preview window)

lansing
1st September 2020, 22:26
Does anyone know how to use the "preview advance setting"? I have no idea what it does, I changed the matrix coeff but nothing happen to my image?

lansing
1st September 2020, 22:51
request for mouse middle click to zoom (similar to "classic" vseditor preview window)

No that's not a good way to zoom. When zooming, you will want to go with something like 100%->150%->200%->250%, little by little, but this along will require 3 clicks if you're to do it with middle click. This should be handle by wheel scroll.

l33tmeatwad
4th September 2020, 20:29
Just tested out the latest from the repository. Everything seems to be working fine, however it always crashes when closing on macOS. Not sure what's going on, haven't had a chance to run a debug, but I figured I'd mention that in case I don't get around to it anytime soon.

ChaosKing
7th September 2020, 10:53
One thing that is a bit annoying in vseditor2 is when your script has an error. With vs1 the log windows was always visible and I could immediately spot the problem. In vs2 you always need to explicitly open the log window (on every program start) to see if there is an error.
Maybe the last status of the log window could also be saved (opened/closed)
OR
a small icon indicates if there an error is present
OR
the log opens automatically if the script contains an error (on F6 / F7 pressed)

lansing
14th September 2020, 15:07
Updating my status, I've been busy playing Xenoblade Chronicle for the past week, update on the project will continue after I finished it.

Tohno_Neil
15th September 2020, 20:22
I tried the R3 X64 version,popup a window and program closed.
:confused:

https://forum.doom9.org/attachment.php?attachmentid=17486&stc=1&d=1600197787

Unable to locate the program input point _ZNSt3pmr20get_default_resourceEv in the dynamic link library Qt5Core.dll


Any debug mode?

l00t
25th September 2020, 09:00
Dear lansing, I really appreciete your work on improving VSEditor. I have a small question regarding when are you planning to put back the Crop Editor? Also Zoom functions bound to 1, 2, 3 was very useful.

Tima
6th October 2020, 13:51
I can't make VSEditor 2 to become default editor for vpy files on Windows:

- I can associate it, but when I click on the script, VSEditor opens with a blank tab instead of the target script.
(VSEditor doesn't even pick up script argument when called via CLI)

- In addidion, I get theme_presets.txt file created in the folder where my script is located.

Both items seem to be regressions compared to v1.

poisondeathray
28th October 2020, 16:15
R3.1 issue with the FI color picker - >8bit seem to read as 8bit values, and sometimes values are off

Works ok in R3.0 or R19 original

sl1pkn07
1st November 2020, 18:35
Hi

i have this when close the app


terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Abortado (`core' generado)


builded with GCC 10.2.0 and QT 5.15.1

and also, anyone can review this?

is for add support for use XDG paths ('/home/$USER/.config' and '/home/$USER/.local/share' ) as directory path defaults for themes and bookmarks in linux


diff --git a/vsedit/src/main_window.cpp b/vsedit/src/main_window.cpp
index 5f068d1..3156207 100644
--- a/vsedit/src/main_window.cpp
+++ b/vsedit/src/main_window.cpp
@@ -2266,11 +2266,24 @@ void MainWindow::slotSaveBookmarksToFile()
{
QFileInfo fileInfo(scriptName);
//get file path and fileName without extension
+#ifdef Q_OS_LINUX
+ QString xdgDataHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
+ if (xdgDataHome.isEmpty())
+ xdgDataHome = QDir::homePath() + "/.local/share/vsedit";
+ QDir xdgDataHome_path;
+ if (!xdgDataHome_path.exists(xdgDataHome))
+ xdgDataHome_path.mkpath(xdgDataHome);
+#else
QString filePath = fileInfo.absolutePath();
+#endif
QString scriptFileName = fileInfo.baseName();

QString fileName = QFileDialog::getSaveFileName(this,
+#ifdef Q_OS_LINUX
+ tr("Save bookmark"), xdgDataHome + QDir::separator() + scriptFileName,
+#else
tr("Save bookmark"), filePath + QDir::separator() + scriptFileName,
+#endif
tr("Text file (*.txt)"));

if (fileName.isEmpty())
diff --git a/vsedit/src/script_editor/script_editor.cpp b/vsedit/src/script_editor/script_editor.cpp
index 238b6e4..4af581b 100644
--- a/vsedit/src/script_editor/script_editor.cpp
+++ b/vsedit/src/script_editor/script_editor.cpp
@@ -941,7 +941,17 @@ void ScriptEditor::loadThemeSettings()
{
QString savedThemeName = m_pSettingsManager->getThemeName();

- QFile file("theme_presets.txt");
+#ifdef Q_OS_LINUX
+ QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
+ if (xdgConfigHome.isEmpty())
+ xdgConfigHome = QDir::homePath() + "/.config/vsedit";
+ QDir xdgConfigHome_path;
+ if (!xdgConfigHome_path.exists(xdgConfigHome))
+ xdgConfigHome_path.mkpath(xdgConfigHome);
+ QFile file(xdgConfigHome + "/theme_presets.txt");
+#else
+ QFile file("theme_presets.txt");
+#endif
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
file.open(QIODevice::WriteOnly); // create file if it doesn't exist
file.open(QIODevice::ReadOnly | QIODevice::Text);
diff --git a/vsedit/src/settings/settings_dialog.cpp b/vsedit/src/settings/settings_dialog.cpp
index e71b833..59c0c20 100644
--- a/vsedit/src/settings/settings_dialog.cpp
+++ b/vsedit/src/settings/settings_dialog.cpp
@@ -285,7 +285,17 @@ void SettingsDialog::loadThemePresets()
* load from temp string and add preset names to theme list model
* the list model will then update combobox automatically
*/
- QFile file("theme_presets.txt");
+#ifdef Q_OS_LINUX
+ QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
+ if (xdgConfigHome.isEmpty())
+ xdgConfigHome = QDir::homePath() + "/.config/vsedit";
+ QDir xdgConfigHome_path;
+ if (!xdgConfigHome_path.exists(xdgConfigHome))
+ xdgConfigHome_path.mkpath(xdgConfigHome);
+ QFile file(xdgConfigHome + "/theme_presets.txt");
+#else
+ QFile file("theme_presets.txt");
+#endif
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
file.open(QIODevice::WriteOnly); // create file if it doesn't exist
file.open(QIODevice::ReadOnly | QIODevice::Text);
@@ -375,7 +381,17 @@ void SettingsDialog::saveThemeSettings()
m_pSettingsManager->setThemeName(
m_ui.themePresetSelectionComboBox->currentText());

- QFile file("theme_presets.txt");
+#ifdef Q_OS_LINUX
+ QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
+ if (xdgConfigHome.isEmpty())
+ xdgConfigHome = QDir::homePath() + "/.config/vsedit";
+ QDir xdgConfigHome_path;
+ if (!xdgConfigHome_path.exists(xdgConfigHome))
+ xdgConfigHome_path.mkpath(xdgConfigHome);
+ QFile file(xdgConfigHome + "/theme_presets.txt");
+#else
+ QFile file("theme_presets.txt");
+#endif
if (!file.open(QFile::WriteOnly | QFile::Truncate | QIODevice::Text )) {
QMessageBox::information(this, tr("Unable to write to file"),
file.errorString());
@@ -933,9 +945,19 @@ void SettingsDialog::slotHandleThemeExport()

void SettingsDialog::slotExportSelectedThemePresets(QStringList &a_selectedThemePresets)
{
+ QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
+ if (xdgConfigHome.isEmpty())
+ xdgConfigHome = QDir::homePath() + "/.config/vsedit";
+ QDir xdgConfigHome_path;
+ if (!xdgConfigHome_path.exists(xdgConfigHome))
+ xdgConfigHome_path.mkpath(xdgConfigHome);
QString defaultDir = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
QString fileName = QFileDialog::getSaveFileName(this,
- tr("Export theme preset"), defaultDir + QDir::separator() + tr("theme"),
+#ifdef Q_OS_LINUX
+ tr("Export theme preset"), xdgConfigHome + QDir::separator() + tr("theme"),
+#else
+ tr("Export theme preset"), defaultDir + QDir::separator() + tr("theme"),
+#endif
tr("Theme file (*.txt)"));

if (fileName.isEmpty())


greetings

lansing
1st November 2020, 22:14
Sorry for the late response, I have finished all my games now and will be back on the project tomorrow. Looks like VSAPI 4.0 is still not ready yet, so I guess I haven't miss anything much.

Jukus
2nd November 2020, 15:43
I installed VSE 2 from https://aur.archlinux.org/packages/vapoursynth-editor-git/ and nothing works, F5 doesn't work, F6 doesn't work, when I open the script from the file manager then a blank document opens instead of the script.

lansing
2nd November 2020, 20:47
I installed VSE 2 from https://aur.archlinux.org/packages/vapoursynth-editor-git/ and nothing works, F5 doesn't work, F6 doesn't work, when I open the script from the file manager then a blank document opens instead of the script.

R3.1 was a test version, try R3

sl1pkn07
4th November 2020, 22:08
R3.1 (R3 tag, 1 commit ahead, not ver "3.1") is only one commit ahead R3

https://bitbucket.org/gundamftw/vapoursynth-editor-2/commits/

outhud
8th November 2020, 12:20
Can someone point to what Qt I should install to get this to compile on Ubuntu 20.04 LTS?

It seems it needs Qt 5.13 at least, but not clear how I should install this. Using the offline installer, and enabling "Sources" in the installer, says it will take over 4.01GB HDD space?

PRAGMA
23rd November 2020, 18:30
Great work so far. Love the little UX improvements here and there, just I have some suggestions (some might be bugs on my end?).

- when opening VS Edit, remember what scripts/tabs were open (this one is driving me mad)
- maybe add a setting that attempts to preview the script automatically when you open the script/tab, if it errors out, then don't retry automatically.
- in the log under the script editor, add support for this to show prints (stdout) not just stderr (this one drove me absolutely mad with the original VS Edit, my only solution is to raise exceptions rather than print or use core.text, both aren't ideal)
- on Linux, kde plasma 5, the UI for the log under the script editor annoyingly has a white border around it if you're on a dark theme.
https://i.imgur.com/p0D8xo7.png
- Also forgive me if I'm missing something obvious, but why is the seek bar so insanely huge height wise?
https://i.imgur.com/MC515si.png
- Maybe a way to pin the Tools' windows next to the preview window so its no longer floating would be nice too.
- Also a way to change the preview to be Bilinear would be nice. Seems the dropdown for the kernel was removed and the hotkey for it doesn't seem to do anything.

:thanks::thanks:

PRAGMA
23rd November 2020, 18:47
R3.1 (R3 tag, 1 commit ahead, not ver "3.1") is only one commit ahead R3

https://bitbucket.org/gundamftw/vapoursynth-editor-2/commits/

I could be wrong but doesn't look like this aur package should be versioned R3.1, since the git itself doesn't have any of the R3.1 changes committed to it yet. The only R3.1 available is a Windows X64 build in Deployments

Jukus
4th December 2020, 13:36
Is the Point resizer used for zoom and there is no way to change it?

Jukus
4th December 2020, 17:46
Just stopped working after restarting
Failed to evaluate the script:
Python exception: D2V cannot be opened.

Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
File "src/cython/vapoursynth.pyx", line 2245, in vapoursynth.vpy_evaluateScript
File "script_9777", line 8, in
File "src/cython/vapoursynth.pyx", line 2069, in vapoursynth.Function.__call__
vapoursynth.Error: D2V cannot be opened.

sl1pkn07
7th December 2020, 21:39
I could be wrong but doesn't look like this aur package should be versioned R3.1, since the git itself doesn't have any of the R3.1 changes committed to it yet. The only R3.1 available is a Windows X64 build in Deployments


┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-editor-git/vapoursynth-editor]|
└───╼ echo $(git describe --long --tags | tr - .)
R3.1.gf38042a
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-editor-git/vapoursynth-editor]|
└───╼ echo $(git describe --long --tags)
R3-1-gf38042a



is a git thing. because makepkg (part of pacman, the archlinux package manager) dont like the "-" in the version

greetings

lansing
17th December 2020, 08:28
Finally back, R3.2 updated.

changelog
Capping frame cache and frame ticket queue sizes, greatly reducing memory usage

I have tested for the last couple of days, the memory issue should be resolved now on my part. The original version had the frame ticket queue and frame cache size set too big, I pretty much disabled them now. Though the memory usage is still a lot higher than Avspmod. For example, my 720x480 dvd source is using 48 MB on playback in avspmod while vseditor is using 105 MB. The original loading of the video is only 62 MB but then it raise as more frames were loaded and were capped at 105 MB. After going through all the codes looking for the cap, I finally realized that the frame caching actually came from vapoursynth, as running benchmark through vspipe results in about the same amount of memory usage.

lansing
1st February 2021, 00:21
Updated version to R4


R4: [2021-01-31]
- Add option to release memory on tab
- Remember tabs on close
- Opening script that was already opened will change to its tab
- Fixed a save file dialog pop up when loading from the recent script list while the active script is labeled as modified
- Fixed script template loading with tabs
- Fixed log window visibility. The window will show up from hidden when there's an error
- Removed the ugly white margin around log window
- Capping frame cache and frame ticket queue sizes, greatly reducing memory usage
- Added "copy to new tab" option to right click tab context menu
- Updated more deprecated type cast


I fixed most of the reported issues, the user experience should be a lot better now. I should start to look at improving syntax highlighting and autocompletion now. And there's issue of 4K video not playing at full speed on playback but I already have it hardware decoded, don't know why.

lansing
3rd February 2021, 07:29
Updated to R4.3


- Added option in menu to open plugins and scripts folder
- Setting of "characters typed to start autocompletion" doesn't affect VS functions anymore
- Autocompletion for VS functions now default to be triggered by zero typed character after "core."
- Added an "about Vapoursynth" dialog to the menu to show current VS and API versions


I fixed the annoying issue with the characters typed to start autocompletion setting option. Before when we set the option to 0, the autocompletion mechanic would be triggered on everywhere by everything like spacebar or enter, but we'll need it to be at 0 or the plugin autocompletion feature would be pointless. Now that option will not affect plugin autocompletion and autocompletion would be triggered after "core." or a period in the chain.

I also added the one click open option for opening the plugins and scripts folders, utilizing vsrepo. I couldn't find a proper way to catch error in QProcess though, for example:

pythonxyz vsrepo.py paths # error caught
python vsrepo.py pathsxyz # error not caught

so I didn't even bother for error checking.

ChaosKing
3rd February 2021, 13:16
Autocompletion for VS functions now default to be triggered by zero typed character after "core."
Much more usable now thx.

lansing
4th February 2021, 07:10
Updated to R4.4

log

- Autocompletion for Python script functions, still in beta
- Some code refactoring on the last commit that is necessary for autocompletion


A beta version for autocompletion for Python script functions, very buggy still. The program will generate the qcomplete model for the scripts you have in your script folder. Functions are parsed by reading the scripts looking for the definitions. Private methods and child methods are ignored. Well that's the best I can think of to filter out the unnecessary ones. For scripts that don't private their utility or helper methods, there's really nothing I can do. They will just be added to the model.

Limitation so far is that the there's no logic to change module name, and I'm still don't know what to do with gigantic functions like QTGMC with like 50+ arguments.

ChaosKing
4th February 2021, 09:53
The autocomplete list shows up on the left side of my screen, but only with havsfunc.
https://i.imgur.com/tLlCTiH.png

lansing
4th February 2021, 10:24
The autocomplete list shows up on the left side of my screen, but only with havsfunc.
https://i.imgur.com/tLlCTiH.png

I think that's probably because of some long definition in the list. I'll take out the arguments in the definitions, that should fix it.

lansing
5th February 2021, 05:47
Updated to R4.6

changelog

- Fixed autocompletion argument value not printing
- Fixed parsing definition with "\"
- Autocompleter list shows only function names instead of the entire definition now, much easier to read


I fixed all the problems I can find for the python script autocompleter, now the whole thing should be usable. A lot of time has been spent unexpectedly on debugging because switching to the new signal/slot syntax somehow broke the text selection logic.

Autocompleter on VS filter arguments doesn't have default values because the current API doesn't provide them, so we'll have to wait for Myrsloik for API 4.

The final piece for autocompletion will be autocompletion for VS Classes (http://www.vapoursynth.com/doc/pythonreference.html) but I don't know where to get that list.

lansing
5th February 2021, 08:40
When I run a script with core = vs.get_core(), in PyCharm, it'll give a warning about the function being deprecated, but in vseditor, nothing was printed.

lansing
6th February 2021, 18:26
After couple of days of reading, I feel like the next evolution for the editor part of the program would be to use a Python language server. It provides autocompletion for all filters and modules (what we have now), as well as keeping track of the type of the variables so we can have autocompletion like vs.YUV420P8 or clip.set_output() and chaining filters, which is what we couldn't do now. And Myrsloik already had the stubs file prepared for that, well the autocompletion still doesn't work well for VideoNode, like allowing things like this:

clip.ffms2.Source(r"hello.mkv")

but it will get there eventually.

ChaosKing
9th February 2021, 09:42
It seems when I press F6 (check script) all tabs a checked. My 1. tab is very slow (heavy filtering) & my 2. tab is fast. I only want to check tab 2, but it takes very long until tab2 show the result. Removing tab 1 results in fast resonse.
Is this by design or a bug?

lansing
9th February 2021, 16:28
It seems when I press F6 (check script) all tabs a checked. My 1. tab is very slow (heavy filtering) & my 2. tab is fast. I only want to check tab 2, but it takes very long until tab2 show the result. Removing tab 1 results in fast resonse.
Is this by design or a bug?

I can't reproduce it. I throws in three smdegrain(tr=6) in tab 1 and check script still running fast for me on tab 2.

lansing
9th February 2021, 17:24
Vapoursynth's memory preallocation is becoming a serious problem too. They can't be release even when the core was deleted. Running checkscript on a few heavy scripts will hoard all memory in a hurry.

ChaosKing
9th February 2021, 19:12
Seems like it was a one time bug xD Can't reproduce it too.

lansing
10th February 2021, 17:52
Updated to R5

changelog

R5: [2021-02-10]
- Bug fixed: switching from tab A with a larger frame number than the max frame number of tab B will cause an out of range frame request error
- Bug fixed: switching to tabs that are not in the same group during playback would keep on playing
- Bug fixed: in group playback, switching to the same tab using hotkey would break the playback
- Fixed missing connect for preview advance setting dialog, but its usage is still unknown to me
- Config file now saved as vsedit2.config to avoid conflicting with the original version
- Updated to VSAPI 3.6 calls, now requires Vapoursynth R47 or higher
- Updated deprecated QProcess calls for encode and job server watcher
- Autocompleter list shows only function names instead of the entire definition
- Autocompletion for Python script functions, but only limited to non alias calls
- Autocompletion popup now triggers on zero character type after "." on known filter/script names, normal words will not be affected
- Added "about Vapoursynth", "open plugins folder" and "open scripts folder" options to menu


An autocompleter for Python scripts, but it doesn't work with alias. So you can only do "havsfunc.QTGMC", no "haf.QTGMC".

And many bug fixes for tab switching on playback, hopefully no more crashings.
Also there're some changes in the QProcess syntax so I need to change some logic for encode and job server watcher, so you may want to test it out to see if they still work.

Ninelpienel
28th February 2021, 13:52
I can't make VSEditor 2 to become default editor for vpy files on Windows:

- I can associate it, but when I click on the script, VSEditor opens with a blank tab instead of the target script.
(VSEditor doesn't even pick up script argument when called via CLI)

- In addidion, I get theme_presets.txt file created in the folder where my script is located.

Both items seem to be regressions compared to v1.

The problem still exists. :/

lansing
2nd March 2021, 06:30
The problem still exists. :/

File association was never implemented on the program side, it just happened to work in the original version by coincident.

I'll look into it.

lansing
2nd March 2021, 21:28
Updated to R5.2,

changelog

- File association for vpy file option on Windows platform, opening vpy will load as new tab in the program
- A vapoursynth logger plugin for vseditor to log warning messages to console


I added a logger vs plugin to log deprecation warning messages to console. Just put the vsedit_logger.dll to the plugin folder and it should work. I tried to load the dll using the custom plugin folder path defined in vseditor but it looks like it had been broken for a long time. So just use the regular plugins folder for now.

The reported line number for fatal error has also been offset by the logger script so just ignore it for now. I'll fix it altogether later after no issues reported for the logger.

For the file association, first try to associate it using right click->open with->choose program to see if it works. The "associate vpy" button in the program setting will write to registry and I'm not sure if it's necessary.

poisondeathray
3rd March 2021, 00:02
R5.2 error msg


Failed to evaluate the script:
Python exception: No attribute with the name vsedit exists. Did you mistype a plugin namespace?

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 2245, in vapoursynth.vpy_evaluateScript
File "script_42", line 29, in
File "src\cython\vapoursynth.pyx", line 1756, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name vsedit exists. Did you mistype a plugin namespace?


script

import vapoursynth as vs
core = vs.get_core()
clip = core.std.BlankClip(format=vs.YUV420P8, length=240, color=[16, 128, 128])
clip = core.std.AssumeFPS(clip, fpsnum=24000, fpsden=1001)
clip = core.text.FrameNum(clip)
clip.set_output()


Script works ok in R5 and earlier versions

lansing
3rd March 2021, 00:08
There's a vsedit_logger.dll in the folder, just put it to the plugin folder

poisondeathray
3rd March 2021, 00:26
There's a vsedit_logger.dll in the folder, just put it to the plugin folder

:o ooohh oops sorry. I thought it was "optional", but I copy/pasted and it works ok now :)

Thanks

lansing
3rd March 2021, 01:21
:o ooohh oops sorry. I thought it was "optional", but I copy/pasted and it works ok now :)

Thanks

It could be hassle free and work right out of the box if the program's user defined plugins path was not broken. I'm still trying to figure out where the problem is.

ChaosKing
3rd March 2021, 08:28
I like the new logger.

But can this be improved with maybe showing the module or filename as additional info?
DeprecationWarning : line 105: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 2142: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 2622: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 1757: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 6: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line -4: get_core() is deprecated. Use "vapoursynth.core" instead. <-- can this be true?

lansing
3rd March 2021, 08:44
I like the new logger.

But can this be improved with maybe showing the module or filename as additional info?
DeprecationWarning : line 105: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 2142: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 2622: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 1757: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line 6: get_core() is deprecated. Use "vapoursynth.core" instead.

DeprecationWarning : line -4: get_core() is deprecated. Use "vapoursynth.core" instead. <-- can this be true?

There shouldn't be negative number. Is the reported line number correct for the rest? How do I reproduce it?

feisty2
3rd March 2021, 09:24
It could be hassle free and work right out of the box if the program's user defined plugins path was not broken. I'm still trying to figure out where the problem is.

you can manually load a plugin not placed in the autoload folder using core.std.LoadPlugin()

ChaosKing
3rd March 2021, 10:14
There shouldn't be negative number. Is the reported line number correct for the rest? How do I reproduce it?

The line numbers are all wrong. (I think they are shifted always? by 19)
https://i.imgur.com/jwnJbaP.png


The -4 is triggerd by

#https://github.com/theChaosCoder/lostfunc
import lostfunc as lst
clip = lst.MfTurd(clip)

lansing
3rd March 2021, 10:26
Yes the line number were offset by 19 because of the logger script that was prepended to the main script. I'll put a check on the origin of the warning message and keep the line number untouch for those that came from imported modules.

lansing
12th March 2021, 09:30
Updated to v5.3

changelog

- Single instance implementation using the KDSingleApplication library
- vsedit logger dll will now auto load on program start up, no more need for putting it into the plugins directory


Took me a lot of time to get this single instance implementation working. The first library I tried was buggy and very unresponsive, took about half a second to response when I double click a vpy file. Now this second library is working correctly and very snappy.

danfgtn
14th March 2021, 01:01
It is very nice to see that someone has continued the project, I have a suggestion and would like to check some problems. It would be nice to have to press enter or click outside the frame box before going to the typed frame. If I want to go to frame 1000, it loads frames 1, 10 and 100 as I type, which is a problem in heavy filtering.

Someone already asked, but I couldn't find an answer, is there any prediction when the crop editor will work?

Also some buttons are cut off here, I tried changing the DPI settings but it didn't work.

https://i.imgur.com/7kZtmvE.png

https://i.imgur.com/EAhlVMa.png

https://i.imgur.com/7jM3tLR.png

These two buttons are without icon, I don't know if they have always been like this

https://i.imgur.com/Pwa7rQd.png

lansing
14th March 2021, 06:50
It is very nice to see that someone has continued the project, I have a suggestion and would like to check some problems. It would be nice to have to press enter or click outside the frame box before going to the typed frame. If I want to go to frame 1000, it loads frames 1, 10 and 100 as I type, which is a problem in heavy filtering.
Will fix.


Someone already asked, but I couldn't find an answer, is there any prediction when the crop editor will work?

I'm currently working on it, the working frame will be movable inside the crop editor window.


Also some buttons are cut off here, I tried changing the DPI settings but it didn't work.

These two buttons are without icon, I don't know if they have always been like this
I don't know much about DPI so this issue will be in my last priority.
There are many actions in the menu that are without icons right now because the icon package (http://www.famfamfam.com/lab/icons/silk/) had like 1,000 icons and it gave me a headache trying to find the right one out of that. You can help if you can spot them.

poisondeathray
29th March 2021, 17:31
vsedit color picker issue with RGB30

-The vsedit2 r5.x branch reads only displays values in the "R" channel (incorrect for "G", "B", "RGB"; for example, the R value should be placed in the "G" channel for the G strip, or the "B" channle for the B strip, etc...)

-works ok in vsedit r19 , vsedit2 r4.x

RGB30 (gbrp10le) R, G, B, R+G+B ramp pattern 0-1023 . 1024x720. FFV1
https://www.mediafire.com/file/3libjjt41q8d3m4/Comp_GradientRamp_RGB30_1024x720_ffv1.mkv/file

clip = core.lsmas.LWLibavSource(r'Comp_GradientRamp_RGB30_1024x720_ffv1.mkv')

poisondeathray
30th March 2021, 06:01
Actually, the color picker seems completely broken in R5.x. When testing 8bit solid color bars, the numbers change almost randomly as you mouse over a color (not dithering issue, solid single color). R4.x works ok

lansing
30th March 2021, 14:34
Actually, the color picker seems completely broken in R5.x. When testing 8bit solid color bars, the numbers change almost randomly as you mouse over a color (not dithering issue, solid single color). R4.x works ok

The color picker was probably broken by one of the filter in the preview filter chain. I'm planning to reimplement it next in my todo list because the current implementation will reload the entire script every time a filter in the chain was turned on/off. Instead I should be using video nodes so that filters that had ran shouldn't need to rerun again. This same workflow should also be use when comparing similar scripts but I don't know the logics yet.

After testing out the warning message logger for some time, I think I will be reverting it back because it basically does nothing beside logging the deprecation warning messages, which no regular users needed it. While the plugin developers will get those warnings anyway using any python ide in development. I will keep the logger filter though as people might need it as a print function for debugging.

fAy01
7th April 2021, 03:45
Thanks for working on this project. I tested it and found a few things maybe you could implement.

1 - Loading a script in vsedit without filepath and just the script name shows preview but currently vsedit2 doesn't have that feature.
2 - The preview doesn't load unless I press the F5 key or hit the preview button. What doesn't work is going to the 'Video' menu and selecting 'Play.'
3 - Is it possible for "Preview Advanced Settings" to fetch information from the d2v/m2ts/mkv/etc. file?
4 - Could you possibly add a search bar in the hotkeys menu?

https://i.imgur.com/cwr9cd9.png

Kind Regards

Tima
9th April 2021, 23:20
A nasty bug: if I open some script and close VSEdit, and then delete this script, VSEdit crashes on all subsequent runs.

Mystery Keeper
10th April 2021, 02:02
A nasty bug: if I open some script and close VSEdit, and then delete this script, VSEdit crashes on all subsequent runs.

No such bug in vsedit. Must be a vsedit 2 thing.

lansing
10th April 2021, 06:06
A nasty bug: if I open some script and close VSEdit, and then delete this script, VSEdit crashes on all subsequent runs.

Cannot reproduce. The program will just warn on missing scripts on next startup and continue running.

lansing
10th April 2021, 06:35
Thanks for working on this project. I tested it and found a few things maybe you could implement.

1 - Loading a script in vsedit without filepath and just the script name shows preview but currently vsedit2 doesn't have that feature.
2 - The preview doesn't load unless I press the F5 key or hit the preview button. What doesn't work is going to the 'Video' menu and selecting 'Play.'
3 - Is it possible for "Preview Advanced Settings" to fetch information from the d2v/m2ts/mkv/etc. file?
4 - Could you possibly add a search bar in the hotkeys menu?

Kind Regards

1. Do you mean loading video file without file path in the source filter? I don't know if it's better to just get the file path with "os.path.dirname(os.path.realpath(__file__))" in the script or have the program do it implicitly. It's just one line of code.

2. Video won't play unless the script has been run. I can disable the button until the script was loaded if that causes confusion.

3. What information are you looking for?

4. I'll add that to the todo list.

fAy01
11th April 2021, 19:39
1. Do you mean loading video file without file path in the source filter? I don't know if it's better to just get the file path with "os.path.dirname(os.path.realpath(__file__))" in the script or have the program do it implicitly. It's just one line of code.
Yes, please. I move files around a lot. I like the convenience of loading the scripts from any storage device.

2. Video won't play unless the script has been run. I can disable the button until the script was loaded if that causes confusion.
Actually, I want the script to load and preview when I press the f5, play button, and video button. Maybe?

3. What information are you looking for?
Actually, nevermind. I think I've misunderstood what it does.

Tima
11th April 2021, 23:53
Cannot reproduce. The program will just warn on missing scripts on next startup and continue running.

Reproduces for me in 100% cases -- it occurs next thing after the warning message.

Stacktrace for VSEdit 2 R5.3 (Win10 x64):
> vsedit.exe!00000000004846b9() Unknown
vsedit.exe!0000000000494509() Unknown
Qt5Core.dll!0000000068b974bb() Unknown
Qt5Widgets.dll!0000000000fe3ce6() Unknown
vsedit.exe!0000000000487df4() Unknown
vsedit.exe!000000000048a36c() Unknown
vsedit.exe!000000000048d267() Unknown
vsedit.exe!0000000000498b8d() Unknown
vsedit.exe!00000000004013c7() Unknown
vsedit.exe!00000000004014cb() Unknown
kernel32.dll!00007ff8839d7974() Unknown
ntdll.dll!00007ff8843ca2d1() Unknown

vigan1
10th May 2021, 10:59
Hello.
I am trying to get vapoursynth up and running on Ubuntu 20.04. But I can't build and install vsedit (vapoursynth editor).

Can you help me getting Vapoursynth editor 2 running on my linux ?

git clone https://bitbucket.org/gundamftw/vapoursynth-editor-2
cd vapoursynth-editor-2/pro
qmake -norecursive pro.pro CONFIG+=release
make

Here is a justepastit of the errors I encounter : https://justpaste.it/23n0j

It seems that ‘splitCommand’ is not a member of ‘QProcess’

feisty2
1st June 2021, 17:42
vsedit doesn't seem to display the indentation of a multi-line string properly, that's kinda weird,,,
https://i.imgur.com/CzvKz9C.png
as you can see from the preview window, the string being displayed is indented and it doesn't appear so in the message box. this problem can be traced back to the original version of vsedit.

core.test.Test() simply prints and returns the string representation of the first frame of a video node

PluginInstantiator::RegisterFunction("Test(clip: vnode)", [](auto Arguments, auto Core) {
auto clip = static_cast<Node>(Arguments["clip"]);
Core.Print(clip[0]);
return static_cast<std::string>(clip[0]);
});

lansing
4th June 2021, 06:49
vsedit doesn't seem to display the indentation of a multi-line string properly, that's kinda weird,,,

as you can see from the preview window, the string being displayed is indented and it doesn't appear so in the message box. this problem can be traced back to the original version of vsedit.

core.test.Test() simply prints and returns the string representation of the first frame of a video node

It probably has to do with styling. Do you have test script and the test filter? How do I print the info to the console?

feisty2
4th June 2021, 08:21
Do you have test script and the test filter? How do I print the info to the console?

script is shown above.

the source code and compiled binary of core.test.Test is available here: https://gist.github.com/IFeelBloated/4b49c340bf5ba960ce3e628e5166d7e1

lansing
4th June 2021, 17:05
script is shown above.

the source code and compiled binary of core.test.Test is available here: https://gist.github.com/IFeelBloated/4b49c340bf5ba960ce3e628e5166d7e1

The script above is an image, I couldn't copy it.

feisty2
4th June 2021, 17:10
alright...


from vapoursynth import *

clp = core.std.BlankClip(width=640, height=480, format=YUV444PS)
clp = core.std.SetFrameProp(clp, "aaa", data=["cccc", "hello"])
blk = core.std.BlankClip()
clp = core.std.ClipToProp(clp, core.std.ClipToProp(blk, core.std.BlankClip()))

clp = core.text.Text(clp, core.test.Test(clp))

clp.set_output()

lansing
4th June 2021, 18:14
It should be fixed now.

c3eni23
13th June 2021, 13:35
Hello,

I already fix some issues and create pull request (https://bitbucket.org/gundamftw/vapoursynth-editor-2/pull-requests/1).
Hope this program can be more useful. :)

lansing
16th July 2021, 02:36
I fixed the problem with the matrix coefficient selection not working correctly in the Preview Advanced Settings. Now changing from rec709 to rec601 will show a change in color in the preview.

I think I'll also move the matrix setting to the preview filter dialogue and remove all the rest in the Preview Advanced Settings, since they served no purpose at all.

Myrsloik
1st August 2021, 13:23
The compat formats will be removed in future builds of VS meaning that you'll have to use RGB24 as output and pack the image yourself. You can get the beta builds with this behavior here:
https://forum.doom9.org/showthread.php?t=183070

Zarxrax
13th August 2021, 23:54
I'm not sure if I'm doing this wrong, but I am trying to write a .py script, and it seems that I have to close and reopen my vaporsynth script every time I want to reload a new version. Simply hitting f5 to update the preview doesn't reload the .py script. Not sure if there is a workaround for that, or if not, maybe scripts/plugins could be reloaded each time you preview the script?

It would also be great if when pressing f5 to preview, it would automatically change focus to the video area, so my arrow keys will let me navigate the video. Save a click of the mouse.

And is there any way to change the resize algorithm used for the preview video? Looks like its using point resize. Or alternatively, it would be fantastic if I could press Alt+Enter to pop up a full-screen preview.

Zarxrax
17th August 2021, 22:29
Okay so I have run into this same problem numerous times now. I will try to open vsedit, and it just wont open, giving an error that it can't open another vpy file (different file than the one I am trying to open). I am thinking this is because its trying to open files that I have previously worked on, but instead of opening the application without opening the file, it simply just stops altogether.

I had previously had this happen after deleting a file, and I was able to recover by bringing the file back. But now its giving this error for a file that still exists. I'm not sure what the issue is, and I can't find anything sort of settings file that I can delete which might reset it.

videoh
17th August 2021, 23:20
Workaround:

Locate vsedit.config
Edit it and wipe out the history by changing to this line (delete stuff after the =):

recent_files_list=

It should be fixed in vsedit of course but this should get you going. Until it is fixed you may want to disable
'Automatically load the last script' in settings. Then use File/Recent scripts as needed; the last one will be at the
top of the list.

Zarxrax
18th August 2021, 01:02
Workaround:

Locate vsedit.config
Edit it and wipe out the history by changing to this line (delete stuff after the =):

recent_files_list=

It should be fixed in vsedit of course but this should get you going. Until it is fixed you may want to disable
'Automatically load the last script' in settings. Then use File/Recent scripts as needed; the last one will be at the
top of the list.

Thank you! I was able to find vsedit2.config in my "AppData\Local" folder. Removing the recent files didn't help, so I ended up deleting the file, and that let me back in to start using the application again!

videoh
18th August 2021, 01:11
Thank you! I was able to find vsedit2.config in my "AppData\Local" folder. Removing the recent files didn't help, so I ended up deleting the file, and that let me back in to start using the application again! Good to hear. I investigated it using vsedit under linux, which accounts for the differences.

lansing
24th August 2021, 22:19
Updated to R5.9 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)


changelog

- Bug fixed: log window not showing indentation correctly
- Removed the implicit warning message logger as it did basically nothing to improve user experience. The only warning message Vapoursynth produces is deprecation warning, which no typical user needed it.
- Rewrote the preview filters chain implementation, now preview filters runs programmatically on processed video node instead of being part of the script. Resulting in faster loading time when switching between preview filters and less memory consumption
- Moved the matrix coefficient setting from the "Preview Advanced Settings" to the preview filter dialog
- Removed Preview Advanced Settings dialog as it was replaced by Preview Filters dialog
- The script processor request only preview frame during playback instead of both output and preview frame. This should give a little speed up on playback
- Bug fixed: manual entering frame number in the navigation box will not trigger on every key press


I removed the warning message logger as stated in the changelog. The Preview Advanced Setting dialog has also been removed, as most of the options are useless. It had been a long time that I have no idea what they do because none of them seems to do anything to the image. The matrix coefficient setting has been fixed now and moved to the Preview Filter Dialog. Before it would not work if the input clip has the Matrix value.

I also rewrote the preview filters chain implementation. Before it was done by appending python script like "main_script + filter1_script + filter2_script". But with this, every little change in the preview filter will result in the reloading of the whole script. Now the filters will run on the resulting node of the main script, so it's faster now.

Another optimized update is a change in the request frame process. Originally the program will request two frames every time, the output frame for retrieving frame properties and a RGB frame for display. But during playback, nobody is going to check for frame info anyway, so I make it only to retrieve the RGB frames instead of both. And from my test playing a 4K 60 fps iphone video, the change gives a little 5% boost in speed. Well it still ran under 60 fps, don't know why. This is probably the next thing I would need to investigate.

Please test for bug.

And ignore the crop editor dialog, it is not done yet.

ChaosKing
25th August 2021, 07:50
In case you need help with the upcoming ApiV4 changes, here's a repo which implemented the necessary changes for v4:https://github.com/YomikoR/VapourSynth-Editor

An alternative could be this plugin https://github.com/DJATOM/LibP2P-Vapoursynth

lansing
25th August 2021, 10:05
In case you need help with the upcoming ApiV4 changes, here's a repo which implemented the necessary changes for v4:https://github.com/YomikoR/VapourSynth-Editor

An alternative could be this plugin https://github.com/DJATOM/LibP2P-Vapoursynth

Thanks, I was just looking for info about packing RGB to image.

ChaosKing
25th August 2021, 10:13
+ Discussion here https://github.com/YomikoR/VapourSynth-Editor/commit/78ddeea46d7835837c929992e6c333916d5419da#comments

lansing
25th August 2021, 16:23
+ Discussion here https://github.com/YomikoR/VapourSynth-Editor/commit/78ddeea46d7835837c929992e6c333916d5419da#comments

I read them. I think using DJATOM's LibP2P library is the way to go. Just plug in the arguments and it will spit out the image. They mentioned about the playback going around 130 fps, I wonder what it would be with 4K video. I'll see how it goes.

DJATOM
25th August 2021, 17:29
With that fix (https://github.com/vapoursynth/vapoursynth/commit/7b1d45d50cf2555be23c52042fde258e3d48816c) I'm now getting ~290 fps with DGSource, vapoursynth-preview and libp2p.

DJATOM
25th August 2021, 17:39
> boy
> ~31 y.o.
:sly:

lansing
25th August 2021, 19:42
I tried YomikoR's packing and got like 3 fps playback on my 4K video with DGSource, the gpu's video decoder is running at 1%. Reverting it back to api 3 has no improvement...what is the problem

DJATOM
25th August 2021, 19:56
Probably your VS somehow lacks the fix. Here's my latest build: installer (https://mega.nz/file/jtFlxK7J#2bEfs0bFVl1xO_Yz5GYEvD20trR1sejjxIinKLPf6A8) | portable (https://mega.nz/file/m9t2RK4Z#PhVWanFhuXCkL7b6areVKvEw2dFzDURwSgxGfoP6voA)

lansing
25th August 2021, 21:17
Probably your VS somehow lacks the fix. Here's my latest build: installer (https://mega.nz/file/jtFlxK7J#2bEfs0bFVl1xO_Yz5GYEvD20trR1sejjxIinKLPf6A8) | portable (https://mega.nz/file/m9t2RK4Z#PhVWanFhuXCkL7b6areVKvEw2dFzDURwSgxGfoP6voA)

Didn't work. I also tried the new api4 RC1 but it's the same. When I revert back to api3 with compatBGR32 output and the video played smooth again.

I'll try invoking it as a plugin to see how it goes.

DJATOM
25th August 2021, 21:30
In API4 you can also create plugin on-the-fly. Example (https://github.com/vapoursynth/vapoursynth/blob/doodle1/src/avisynth/avisynth_compat.cpp#L299).

lansing
26th August 2021, 00:02
The libP2P plugin returns a Gray32 frame, which is a API4 format. So that means I'll probably have to update most of the function syntax before I can test it out lol.

DJATOM
26th August 2021, 00:06
Indeed. Gray32 is convenient for packed formats. Maybe it also can fit into Gray8 and x4 width, I haven't tried.

Yomiko
26th August 2021, 00:46
In API4 you can also create plugin on-the-fly. Example (https://github.com/vapoursynth/vapoursynth/blob/doodle1/src/avisynth/avisynth_compat.cpp#L299).

Indeed that's where I'm stuck with v3 API. Invoking an existing plugin is the convenient way in v3. Invoking a compiled plugin with LoadPlugin is not too horrible. But createFilter and fetching the node from the out VSMap seems doubtful.

As for the Gray32 format, since only bit operations are involved in packing, most formats should work, at least if not further touched by other filters.

Edit:
createFilter and fetching the node from the out VSMap is okay. My code has a bug in packing to Gray8 with 4x width.

Edit:
Now both are done.

Yomiko
26th August 2021, 00:49
I tried YomikoR's packing and got like 3 fps playback on my 4K video with DGSource, the gpu's video decoder is running at 1%. Reverting it back to api 3 has no improvement...what is the problem

Probably the reason mentioned in #209.

lansing
30th August 2021, 16:27
Vapoursynth's newest commit just included LibP2P as dependency, which mean I can invoke the RGB pack/unpack filters without worrying about having an extra dependency for vsedit2, yay. I also finished updating all vsapi4 syntax I can find for the program, now I'm just waiting for the next VS RC build for test.

DJATOM
30th August 2021, 18:32
I don't see an interface for this (pack/unpack), but sure if you managed to invoke p2p from your end, it's nice.

Yomiko
1st September 2021, 10:48
For your reference, in my mod I ended up keeping each preview frame until the next one comes in this commit (https://github.com/YomikoR/VapourSynth-Editor/commit/fa533a77785b7a2c6ec0cae5e298dd32990376eb). It seems this is not necessary for working with V3 API provided the preview QImage is constructed by reference (I don't know why and why it breaks with V4), but it brings some acceleration.

lansing
4th September 2021, 19:52
I got the preview working now with invoking the libp2p plugin in the program, that's with the latest VS R55 RC3. The playback speed did go back to normal again like vsapi3. So doing the packing through the vapoursynth end did resolved the turtle speed issue.

I also tested both libp2p R1 and R2, with R2 just a tiny bit faster, maybe the new acceleration in R2 is not for my use case?

I don't have the problem Yomiko has with the need on keeping the preview frame reference.

---------------------------------------------------------------

I'm still investigating the sub-realtime playback problem for my 4K 60 fps clip. Here's a speed comparison using vsedit2 and vsedit mod2 so far:


vsedit2

fps mode fps gpu usage
60 ~30 16%
unlimited ~50 22%


vsedit mod2

60 ~50 19%-29%
unlimited >60 47%


My computer can go as high as over 60 fps but somehow when I set the fps mode to 60, it was playing at much less than 60 fps. Why?

As a side note, I should also create a playback fps counter like avspmod because I'm just guessing by looking at the time counter right now.

Yomiko
5th September 2021, 03:42
Just curious. Did you also take benchmarks with BlankClip?

lansing
9th September 2021, 18:57
Updated to R6 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/), now with VSAPI 4 implemented.

changelog

- Implemented VSAPI 4, program now requires Vapoursynth R55+ to run
- libP2P Vapoursynth plugin will be required for previewing frame
- refactored the preview filter in the filter chain into separate functions
- cosmetic on frame properties matrix display
- bug fixed: color picker producing wrong color that was introduced in commit
- Bug fixed: manual entering frame number in the navigation box will not trigger on every key press
- The script processor request only preview frame during playback instead of both output and preview frame.
This should give a little speed up on playback
- Rewrote the preview filters chain implementation, now preview filters runs programmatically on
processed video node instead of being part of the script. Resulting in faster loading time when
switching between preview filters and less memory consumption
- Moved the matrix coefficient setting from the "Preview Advanced Settings" to the preview filter dialog.
- Removed Preview Advanced Settings dialog as it was replaced by Preview Filters dialog
- Bug fixed: log window not showing indentation correctly
- Bug fixed: defined an absolute path for the theme_presets file so that opening the program through
vpy would not generate a new one on the current directory
- Single instance implementation using the KDSingleApplication library
- File association for vpy file option on Windows platform, opening vpy will load as new tab in the program


You'll need the LibP2P plugin to work:
https://github.com/DJATOM/LibP2P-Vapoursynth

As for the preview, I don't know what is the universal RGB format to convert to. Right now I just convert everything to RGB24.

Myrsloik
9th September 2021, 19:04
Updated to R6 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/), now with VSAPI 4 implemented.

...

You'll need the LibP2P plugin to work:
https://github.com/DJATOM/LibP2P-Vapoursynth

As for the preview, I don't know what is the universal RGB format to convert to. Right now I just convert everything to RGB24.

Why don't you integrate the plugin into your program? It's easy to do and then user won't have to muck about with a separate dependency.

See the packrgb32 bit, that's all you need.
https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp#L256

lansing
9th September 2021, 19:36
Why don't you integrate the plugin into your program? It's easy to do and then user won't have to muck about with a separate dependency.

See the packrgb32 bit, that's all you need.
https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp#L256

I was expecting VS to include it as a core plugin in the future.

Myrsloik
9th September 2021, 19:40
I was expecting VS to include it as a core plugin in the future.

Trivial packing is not a core feature.

lansing
10th September 2021, 06:13
I'm still investigating the sub-realtime playback problem for my 4K 60 fps clip. Here's a speed comparison using vsedit2 and vsedit mod2 so far:

My computer can go as high as over 60 fps but somehow when I set the fps mode to 60, it was playing at much less than 60 fps. Why?


More update on this, I narrowed down the problem to Qt's QImage to QPixmap conversion speed being too slow. The conversion from packed RGB to QImage also took some processing time but the video can still be played in real time. It's the QImage->QPixmap conversion that cut the speed in half.

QImage frameImage(pData, width, height, QImage::Format_ARGB32);
QPixmap framePixmap = QPixmap::fromImage(frameImage);

_Al_
10th September 2021, 19:57
I experienced similar constructing QT preview using QImage.Format_RGB888 from vapoursynths RGB24, it was quite slow, then looking into Mystery Keeper code, he used packed RGB and . Did that (though in Python's pyqt5) and it just visibly sped up preview.
something:
img = dstack( [array(rgb24.get_frame(f).get_read_array(i), copy=False) for i in range(3)])
img = QImage(img, img.shape[1], img.shape[0], QImage.Format_RGB888)
pixmap = QPixmap.fromImage(img)
versus packed RGB:
img = QImage(compatBGR32.get_frame(f).get_read_array(0), w, h, stride, QImage.Format_RGB32).mirrored()
pixmap = QPixmap.fromImage(img).scaled(scale_w, scale_h, **modes)

lansing
10th September 2021, 21:31
I experienced similar constructing QT preview using QImage.Format_RGB888 from vapoursynths RGB24, it was quite slow, then looking into Mystery Keeper code, he used packed RGB and . Did that (though in Python's pyqt5) and it just visibly sped up preview.
something:
img = dstack( [array(rgb24.get_frame(f).get_read_array(i), copy=False) for i in range(3)])
img = QImage(img, img.shape[1], img.shape[0], QImage.Format_RGB888)
pixmap = QPixmap.fromImage(img)
versus packed RGB:
img = QImage(compatBGR32.get_frame(f).get_read_array(0), w, h, stride, QImage.Format_RGB32).mirrored()
pixmap = QPixmap.fromImage(img).scaled(scale_w, scale_h, **modes)

The frame data was already packed RGB through libp2p. I tried turning off the QImage->QPixmap conversion and I was getting around 100 fps with "unlimited fps mode". Turned in on again and it was cut to 30 fps.

_Al_
10th September 2021, 21:54
Yes but what about us, poor python developers, shadowing real developers, how should we approach this in code if using pyqt5 for example? :-)

lansing
10th September 2021, 23:30
Yes but what about us, poor python developers, shadowing real developers, how should we approach this in code if using pyqt5 for example? :-)

You can pack it with libP2P plugin in the script


clip = core.resize.Point(clip, format=vs.RGB24)
clip = core.libp2p.Pack(clip)


And then it should be the same thing as C++

Yomiko
11th September 2021, 00:59
It's the QImage->QPixmap conversion that cut the speed in half.


QPixmap framePixmap = QPixmap::fromImage(frameImage, Qt::NoFormatConversion);

irrc (at least in pyqt5) the default flag could lead to a conversion in certain cases.
The old .mirrored() method for COMPAT format at least copied the frame, too, but I don't know why I didn't hear lots of complain about the performance.

_Al_
11th September 2021, 01:17
oh wow, thanks lansing and DJATOM
cannot test it now though, I'm running API4 portable so far

lansing
11th September 2021, 03:25
More update on this, I narrowed down the problem to Qt's QImage to QPixmap conversion speed being too slow. The conversion from packed RGB to QImage also took some processing time but the video can still be played in real time. It's the QImage->QPixmap conversion that cut the speed in half.


Some more non-preview benchmarks on the plugins. With a 4K video, decode with DGSource:

R55 R54
no conversion: 159 fps 196 fps
convert to RGB24: 107 fps 179 fps
convert to RGB24 + libP2P pack: 77 fps


It turned out that another big bottleneck is the resize filter in R55??


clip = core.resize.Point(clip, format=vs.RGBS)
# 58 fps

clip = core.resize.Point(clip, format=vs.RGB30)
# 85 fps

clip = core.resize.Point(clip, format=vs.RGB48)
# 86 fps

Selur
11th September 2021, 14:08
Argh,... those benchmarks are kind of the opposite of what I expected when I read:
It also performs better on most scripts and computers for those of you who don't care about audio. source: https://forum.doom9.org/showpost.php?p=1951233&postcount=4400

Myrsloik
11th September 2021, 14:41
Some more non-preview benchmarks on the plugins. With a 4K video, decode with DGSource:

R55 R54
no conversion: 159 fps 196 fps
convert to RGB24: 107 fps 179 fps
convert to RGB24 + libP2P pack: 77 fps


It turned out that another big bottleneck is the resize filter in R55??


clip = core.resize.Point(clip, format=vs.RGBS)
# 58 fps

clip = core.resize.Point(clip, format=vs.RGB30)
# 85 fps

clip = core.resize.Point(clip, format=vs.RGB48)
# 86 fps


Exactly where in the source do you do the requests? I want to look at it myself.

lansing
12th September 2021, 01:05
Exactly where in the source do you do the requests? I want to look at it myself.

this (https://bitbucket.org/gundamftw/vapoursynth-editor-2/src/a3405bd2fa31221ca68662d704694a3514094003/common-src/vapoursynth/vapoursynth_script_processor.cpp#lines-484)

lansing
2nd October 2021, 00:54
More update on this, I narrowed down the problem to Qt's QImage to QPixmap conversion speed being too slow. The conversion from packed RGB to QImage also took some processing time but the video can still be played in real time. It's the QImage->QPixmap conversion that cut the speed in half.

QImage frameImage(pData, width, height, QImage::Format_ARGB32);
QPixmap framePixmap = QPixmap::fromImage(frameImage);


More update, for testing, I want to see how the speed goes if I don't output any image. So I took out the QImage conversion step and let the playback runs with no preview. The speed did went up a lot but still it didn't come close to the one from benchmark. My GPU was running about 90% on benchmark but only 55% from the test. So I was losing about half the speed just by entering the play queue before doing anything.

MysteryX
2nd October 2021, 23:51
I double-click on vsedit.exe and nothing happens. I did install libp2p. Is there some other dependency? On Windows 10 x64.

lansing
3rd October 2021, 00:17
I double-click on vsedit.exe and nothing happens. I did install libp2p. Is there some other dependency? On Windows 10 x64.

The program should be able to start even without libp2p. This should be caused by another problem. My guess is the vsedit2.config file? Try rename the vsedit2.config and let the program create a new one and see how it goes.

MysteryX
3rd October 2021, 15:15
The program should be able to start even without libp2p. This should be caused by another problem. My guess is the vsedit2.config file? Try rename the vsedit2.config and let the program create a new one and see how it goes.

No such file.

lansing
8th October 2021, 08:58
More update, for testing, I want to see how the speed goes if I don't output any image. So I took out the QImage conversion step and let the playback runs with no preview. The speed did went up a lot but still it didn't come close to the one from benchmark. My GPU was running about 90% on benchmark but only 55% from the test. So I was losing about half the speed just by entering the play queue before doing anything.

Issue resolved. The problem was a mixed of the capping of frame request queue size that I committed back in R3 + QImage => QPimxap conversion + VS R55. The problem wasn't really noticeable until working with 4K contents.

Now on 4K video the preview is able to run at 160 fps in "unlimited fps" mode, which is surprisingly, a lot faster than Avspmod at 53 fps. Taking out QImage->QPixmap conversion like Yomiko did increased the speed from like 30 to 160 fps.

R6.1 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)

Selur
9th October 2021, 09:47
Nice, now it just needs to get Qt6 compatible. :) (main annoyance is that they changed how regular expression handling worked,..)

lansing
9th October 2021, 20:32
Nice, now it just needs to get Qt6 compatible. :) (main annoyance is that they changed how regular expression handling worked,..)

I haven't looked at Qt6, what it has to offer over Qt5?

Selur
9th October 2021, 22:41
Main point for me is that they fixed a few issues with MacOS, also c++17 is used.
(which is why I build all my code on macos against qt6 ;))
+ They just release Q6.2 which is an LTS version.

Cu Selur

Selur
9th October 2021, 23:16
btw. just tried to build your source in QCreator on Windows and the pro file lists a few files in src/crop_editor which do not seem to be part of the project (any more?), after removing those entries veditr builds,..

lansing
9th October 2021, 23:27
btw. just tried to build your source in QCreator on Windows and the pro file lists a few files in src/crop_editor which do not seem to be part of the project (any more?), after removing those entries veditr builds,..

I got similar report on my issue page. The crop editor was still in WIP but I got tire of commenting them out on every new releases, so a few commits ago I decided to just leave them there. But then I forgot to commit other related files so the project couldn't find them on build lol.

Anyway, I will have an update on it by like tomorrow.

Selur
10th October 2021, 07:12
no problem.

Greenhorn
11th October 2021, 07:36
Some weird things:
1) The "Close tab" and "Close all tabs" buttons have no icons.
2) The fonts all default to "monospace", which is just MS Shell Dlg.
3) With DPI scaling enabled, most text in buttons overflows the its ui elements. (ex, the frame/time toggle on the timeline reads ram/lime)

Something I'm missing? Library I need to install, something like that?

no1d
14th October 2021, 13:50
The program should be able to start even without libp2p. This should be caused by another problem. My guess is the vsedit2.config file? Try rename the vsedit2.config and let the program create a new one and see how it goes.

In my case the program kept crashing because there was no config file.
Renaming vsedit.config to vsedit2.config solved it for me.

MysteryX
14th October 2021, 23:39
In my case the program kept crashing because there was no config file.
Renaming vsedit.config to vsedit2.config solved it for me.
huh. I tried again a long while later, perhaps after some reboots.

Now it starts. I haven't changed anything.

Reclusive Eagle
22nd October 2021, 02:52
Quality of life changes suggestion:
First, its really, really not clear libp2p is required. You have to dig into the repository to find the changelog. I suggest you update the read me with the new dependencies.

2: We need chroma resampling filter viewing options back. They don't need to be in advanced preview like they were before but currently the preview looks as though its based on point filtering.
I see no way to change this at all. If there is please let me know but its extremely difficult to see detailed changes to clips based on point filtering. Even if its slower, I'd rather have slower preview scrubbing than not being able to properly see changes at all. I'd rather it be permanently Lanscoz based or Spline64.

3: Please, I'm begging you. Add the ability to ctrl v the error log. I don't know why we have the ability to highlight text but pressing ctrl v does nothing to the highlighted text. Its so backwards that you can highlight something but to copy and paste text you have to right click and copy. I am actually losing my mind at this point. It would be a 10/10 quality of life change.

Future suggestion:
It would be great if the preview filters got an update to display different color matrix layers.
Currently its just black and white Y U V but if it were able to detect and dynamically change to preview separate RGB layers in color along with color versions-
of the U V blue and red projections that would be amazing.

I know this can be done through other plugins but to have that natively supported without the need to remember additional code make VSE2 even better.

lansing
22nd October 2021, 04:22
Quality of life changes suggestion:
First, its really, really not clear libp2p is required. You have to dig into the repository to find the changelog. I suggest you update the read me with the new dependencies.

2: We need chroma resampling filter viewing options back. They don't need to be in advanced preview like they were before but currently the preview looks as though its based on point filtering.
I see no way to change this at all. If there is please let me know but its extremely difficult to see detailed changes to clips based on point filtering. Even if its slower, I'd rather have slower preview scrubbing than not being able to properly see changes at all. I'd rather it be permanently Lanscoz based or Spline64.

3: Please, I'm begging you. Add the ability to ctrl v the error log. I don't know why we have the ability to highlight text but pressing ctrl v does nothing to the highlighted text. Its so backwards that you can highlight something but to copy and paste text you have to right click and copy. I am actually losing my mind at this point. It would be a 10/10 quality of life change.

Future suggestion:
It would be great if the preview filters got an update to display different color matrix layers.
Currently its just black and white Y U V but if it were able to detect and dynamically change to preview separate RGB layers in color along with color versions-
of the U V blue and red projections that would be amazing.

I know this can be done through other plugins but to have that natively supported without the need to remember additional code make VSE2 even better.

1. I'll put a check on program start and warns about the dependency.

2. I have not found a valid reason to put chroma subsampling on a zooming feature, which should not have any extras added to the image. And that's how you can see the true differences when comparing frames. Photoshop is doing the same thing on zooming too. You'll have to show me a good reason for it.

3. Will fix. I have noticed this for a long time but it just got over my head time and time again.


For the RGB channels, it was not useful. The only scenario I can think of that shows its usefulness is for monitoring underwater footage, where it has no red and you wanted to add some red back to the red channel.

Selur
22nd October 2021, 16:31
When opening 'vapoursynth-editor-2/pro/vsedit/vsedit.pro' in QtCreator and running qmake it uses
qmake vsedit.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
and I get
Project ERROR: failed to parse default search paths from compiler output
also tried to build it using the build instructions without qtcreator, but that failed to.

-> any hints on how to build vsedit on Ubuntu 20.04 in QtCreator ? (build-essential, qtbase5-dev; qt5-default, qtcreator and all it's dependencies are installed)

Cu Selur

Are_
22nd October 2021, 23:44
Qtcreator is probably not supported as a build system and with such helpful error messages, it's not exactly easy to help you.

sl1pkn07
23rd October 2021, 20:08
seems you need build-essentials or something

try to no set `-spec linux-g++`

in any case. fail to biuld for me in my archlinux


g++ -c -pipe -O0 -g -ggdb3 -std=c++17 -Wall -Wextra -Wredundant-decls -Wshadow -pedantic -g -D_REENTRANT -Wall -Wextra -fPIC -DKDSINGLEAPPLICATION_STATIC_BUILD -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_QML_DEBUG -I. -I/usr/include/qt -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I../../vsedit/generated/moc -I../../vsedit/generated/ui -I/usr/lib/qt/mkspecs/linux-g++ -o ../../vsedit/generated/obj-debug-64bit-gcc/vapoursynth_script_processor.o ../../common-src/vapoursynth/vapoursynth_script_processor.cpp
In file included from ../../common-src/vapoursynth/vapoursynth_script_processor.cpp:1:
../../common-src/vapoursynth/vapoursynth_script_processor.h: In constructor 'VapourSynthScriptProcessor::VapourSynthScriptProcessor(SettingsManagerCore*, VSScriptLibrary*, QObject*)':
../../common-src/vapoursynth/vapoursynth_script_processor.h:129:16: warning: 'VapourSynthScriptProcessor::m_cpCoreInfo' will be initialized after [-Wreorder]
129 | VSCoreInfo m_cpCoreInfo;
| ^~~~~~~~~~~~
../../common-src/vapoursynth/vapoursynth_script_processor.h:119:10: warning: 'bool VapourSynthScriptProcessor::m_finalizing' [-Wreorder]
119 | bool m_finalizing;
| ^~~~~~~~~~~~
../../common-src/vapoursynth/vapoursynth_script_processor.cpp:40:1: warning: when initialized here [-Wreorder]
40 | VapourSynthScriptProcessor::VapourSynthScriptProcessor(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../common-src/vapoursynth/vapoursynth_script_processor.cpp: In member function 'QString VapourSynthScriptProcessor::framePropsString(const VSFrame*) const':
../../common-src/vapoursynth/vapoursynth_script_processor.cpp:811:25: warning: declaration of 'error' shadows a previous local [-Wshadow]
811 | int error;
| ^~~~~
../../common-src/vapoursynth/vapoursynth_script_processor.cpp:720:9: note: shadowed declaration is here
720 | int error;
| ^~~~~
../../common-src/vapoursynth/vapoursynth_script_processor.cpp: In member function 'VSNode* VapourSynthScriptProcessor::invokeAkarinExpr(VSNode*, std::string)':
../../common-src/vapoursynth/vapoursynth_script_processor.cpp:1072:24: error: '_strdup' was not declared in this scope; did you mean 'strdup'?
1072 | const char* expr = _strdup(a_expr.c_str()); // convert string to char*
| ^~~~~~~
| strdup
make[1]: *** [Makefile:2234: ../../vsedit/generated/obj-debug-64bit-gcc/vapoursynth_script_processor.o] Error 1
make[1]: Leaving directory '/run/media/sl1pkn07/COSAS/aplicaciones/vapoursynth-editor-2/pro/vsedit'
make: *** [Makefile:49: sub-vsedit-vsedit-pro-make_first] Error 2

lansing
23rd October 2021, 20:58
seems you need build-essentials or something

try to no set `-spec linux-g++`

in any case. fail to biuld for me in my archlinux



Try replacing it with "strdup" instead, Qt complains about it being deprecated, that's why I change it to "_strdup". Seems like _strdup works only with Windows.

lansing
23rd October 2021, 23:15
Update to version R6.3 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)

simplified changelog

- Preview filter UV plane contrast boosted so the chroma noise are more visible. Requires Akarin plugin. If the plugin is not installed, the feature will be turned off
- Resize UV plane in preview filters to match input resolution so that it doesn't look awkward for subsampling formats


And I fixed all reported bugs.

Here's a example about the difference between contrast boosted UV plane

before:
https://i.imgur.com/0wMaB7S.png

after:
https://i.imgur.com/6UYoB8e.png

It should be useful for people trying to clean up the noise in UV plane. The Akarin plugin (https://github.com/AkarinVS/vapoursynth-plugin) is required.

sl1pkn07
24th October 2021, 00:21
Try replacing it with "strdup" instead, Qt complains about it being deprecated, that's why I change it to "_strdup". Seems like _strdup works only with Windows.


i remember you can force deprecated thigs in Qt if add -DQT_DISABLE_DEPRECATED_BEFORE=0x050b00" (the hex is changed depend of the version of deprecation). but idk how force it in qmake (the line is for cmake based projects)

https://doc.qt.io/qt-5/qtglobal.html#QT_DISABLE_DEPRECATED_BEFORE

greetings

EDIT: pull changes to 3524b58 can abre to build without problems

but seems not play well with 4K non-Hidpi displays. some text in buttons not fit well and some widgets is bigger than usual

https://i.ibb.co/rpbjX9p/Screenshot-20211024-013523.png
https://i.ibb.co/cvygzh7/Screenshot-20211024-013629.png
https://i.ibb.co/7NNQ08M/Screenshot-20211024-013748.png

greetings

lansing
24th October 2021, 00:59
but seems not play well with 4K non-Hidpi displays. some text in buttons not fit well and some widgets is bigger than usual


I haven't touch anything on high dpi support yet. I have a 1440p monitor myself with text scaled to 125%, and the text on the buttons are overflowing too lol. It's not an urgent problem though, so it'll just have to wait a while.

Reclusive Eagle
24th October 2021, 02:17
Thank you so much for fixing the copy paste thing and you did it so quickly you are amazing lansing!

May I suggest 1 more crucial thing to implement in future?

So AvsPmod has this amazing feature where you can exit without saving and reopen to where you left off.
By itself its not that amazing. However, a lot of the time scripts can tend to push VapourSynth too far and crash it, it can become permanently not responding etc.
This can also be caused by future and current bugs.
If VapourSynth Editor 2 saved current scripts as temp files like AvsPmod does, it would mean even if VapourSynth crashes you can just reopen it and recover all your code. Potentially saving you hours or even days of work because of a hung program or crash.

l33tmeatwad
28th October 2021, 17:55
Pro files need to be updated for it to compile on macOS, change from:

contains(QMAKE_COMPILER, clang) {
QMAKE_CXXFLAGS += -stdlib=libc++
}
To:
contains(QMAKE_COMPILER, clang) {
QMAKE_CXXFLAGS += -stdlib=libc++
CONFIG += c++17
}
In dark mode the text is black on dark gray...and it crashes when previewing or closing the application.

lansing
28th October 2021, 21:19
Pro files need to be updated for it to compile on macOS, change from:

contains(QMAKE_COMPILER, clang) {
QMAKE_CXXFLAGS += -stdlib=libc++
}
To:
contains(QMAKE_COMPILER, clang) {
QMAKE_CXXFLAGS += -stdlib=libc++
CONFIG += c++17
}
Added. Thanks.


In dark mode the text is black on dark gray...and it crashes when previewing or closing the application.
The program doesn't have a dark mode.

l33tmeatwad
28th October 2021, 21:26
The program doesn't have a dark mode.
I'm referring to macOS dark mode, the newer versions of Qt allow dark mode to adjust the applications. If the text is set to black it won't adjust, but if it's like default it will change to white in dark mode. I actually had to make that adjustment in a program that I've made.

lansing
30th October 2021, 01:24
I have corrected the wave form histogram from vapoursynth-histogram (https://github.com/dubhater/vapoursynth-histogram/pull/8). Now it's possible to add the wave form monitor and RGB parade to the program.

lansing
31st October 2021, 09:46
Update to version R6.4 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)

All bug fixes. Took some time to debug a crash that was caused by using QPixmap created from QPixmap::fromImage(frameImage, Qt::NoFormatConversion). This pixmap doesn't have the shallow copy feature of regular QPixmap. So in cases of a failed script, the framepainter would still look for a saved copy of a frame to paint, and crashed when it couldn't find any. A solution to this is to make a manual copy with framePixmap.copy(), but then 4K playback speed would turns turtle again.

The workaround is to just set a dummy pixmap to the framepainter before the preview call, so when script fails, there would still be a pixmap copy saved in the framepainter.

motbob
31st October 2021, 18:10
6.4 crashes when I try to open preview. Windows 10. I can provide logs if you tell me how.

lansing
31st October 2021, 18:42
6.4 crashes when I try to open preview. Windows 10. I can provide logs if you tell me how.

How to reproduce it?

motbob
31st October 2021, 18:56
How to reproduce it?

Extract contents of R6.4 folder to desktop. Double-click vsedit.exe. Write one of the following scripts:

import vapoursynth as vs
from vapoursynth import core

video = core.ffms2.Source(source=r"C:\Storage\Downloads\funi.mkv")

video.set_output()

Or,

import vapoursynth as vs
from vapoursynth import core

video = core.lsmas.LWLibavSource(source=r"C:\Storage\Downloads\funi.mkv")

video.set_output()

Press preview button or press f5. Program closes. The "Benchmark" function works fine.

EDIT: I'm on R57, should've mentioned.

EDIT2: Oh, I guess you need the LibP2P plugin, or it will crash without an error message. I discovered this by looking at the changelog by chance. Forgive me if this was put somewhere prominent and I missed it, but if not, perhaps put this dependency in the OP or something.

lansing
31st October 2021, 20:51
EDIT2: Oh, I guess you need the LibP2P plugin, or it will crash without an error message. I discovered this by looking at the changelog by chance. Forgive me if this was put somewhere prominent and I missed it, but if not, perhaps put this dependency in the OP or something.

I updated the OP on requirements.

The library could be implemented into the program through its API, which makes it works right out-of-the-box. But then as more features are to be added, there is going to be more dependencies anyway, so it doesn't matters.

lansing
2nd November 2021, 05:51
Update to version R6.4 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)

All bug fixes. Took some time to debug a crash that was caused by using QPixmap created from QPixmap::fromImage(frameImage, Qt::NoFormatConversion). This pixmap doesn't have the shallow copy feature of regular QPixmap. So in cases of a failed script, the framepainter would still look for a saved copy of a frame to paint, and crashed when it couldn't find any. A solution to this is to make a manual copy with framePixmap.copy(), but then 4K playback speed would turns turtle again.

The workaround is to just set a dummy pixmap to the framepainter before the preview call, so when script fails, there would still be a pixmap copy saved in the framepainter.

I finally found the reason for the crash. A better explanation quoted from here (https://interest.qt-project.narkive.com/bQJNQHCv/convertion-between-qimage-to-qpixmap-taking-to-much-time):

You construct your QImage from a uchar* right? This constructor does not take a deep copy of the image data you pass in, it just stores it. That means that if you for some reason delete the source data before Qt takes it into use (which happens typically on the next paint cycle or in your custom graphics item), you will have a dangling pointer in the QImage you are drawing and that will typically crash.

The solution is to keep the image data alive before the next paint event, which means keeping the VSFrame alive, just like Yomiko did here (https://forum.doom9.org/showthread.php?p=1951082#post1951082).

lansing
14th November 2021, 01:21
Update to version R6.5 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)

A new scopes dialog window to display histograms/waveform/scopes/RGB parade. So far I only have the waveform added to see how to user experience goes. There are still many things to consider, for example, how should the graphs be displayed? Should we display each one at a time or with 4 different graphs stitched together? What are people's usage routine? And then there's the decision on the resolution of the waveform, for right now I have it scaled down to 480 x 320.

And then there's the RGB parade implementation, do I implement it right into vsedit2 or the histogram filter? As the latter will lack customization.

I also added a check for dependency plugins when you press preview, so there should be no more crashes on missing dependencies. For the vapoursynth-histogram plugin, use my fork (https://github.com/gundamftw/vapoursynth-histogram/releases) for now as jackoneill haven't been active for a while to update the main one.

Tima
26th November 2021, 11:54
R6.5 exits immediately after pressing F5.

Win10, VS r57 portable, LibP2P r2.

from vapoursynth import core
clip = core.std.BlankClip()
clip.set_output()

EDIT: I was using the original vapoursynth-histogram plugin instead of the temporary fork.
Since the silent crash is very confusing, I'd suggest to put the warning instead.

Tima
24th December 2021, 11:58
Some more bugs/crashes:

1. As I noticed today, R6.5 still crashes on the sample clip (but works fine on other "real world" inputs, like FFMS2) even with correct LibP2P and vapoursynth-histogram mod:
from vapoursynth import core
clip = core.std.BlankClip()
clip.set_output()

2. R6.5 crashes when trying to output grayscale video:

from vapoursynth import core

<some ordinary processing script>

# Uncommenting the line below crashes VSEdit
clip = core.std.ShufflePlanes(clips=clip, planes=1, colorfamily=vs.GRAY)

clip.set_output()


3. When using prefilter to view a single YUV plane, image contrast jumps up and down on U/V planes when playing back the output (because of the contrast boost?).

4. When you choose some plane in preview filter and then change script and reload the review, the image is shown without filters (but the button is still activated).

5. Feature request: please, make "UV plane contrast boost" "UV plane resize to match input resolution" features to be configurable (maybe just add toggle buttons in Prefilter dialog window?).

tuanden0
7th January 2022, 06:36
Help. I couldn't open vpy script.

Downloaded the lastest version and can open it.
Downloaded the LibP2P and extract it to vapoursynth-plugins 64bit folder
Try to run vpy script to check => error missing LibP2P, vapoursynth-histogram, akarin
Try to add vapoursynth plugin path to VSE 2 => unable to open it untill remove config and config2

~ VEGETA ~
27th January 2022, 14:20
hello, when i try to see the script by pressing f5 on windows 10 the program stops responding and closes despite vsedit 1 works fine. i made sure to install all dependencies.

lansing
29th January 2022, 09:52
Update on my progress, I'm back and currently working on the RGB Parade preview filter. I acknowledged the crash that was created by the waveform monitor. I will have an fixed version in a couple of days.

~ VEGETA ~
29th January 2022, 19:40
so can we expect it to work fine with vs57 in couple of days? thanks for your efforts.

plus wanted to ask you if there are any hotkeys for scenefiltering.

Zarxrax
7th February 2022, 22:59
Nothing happens when I execute vsedit.exe. No window comes up, no error message, nothing.
R6.5, and I put the LibP2P dll into the vapoursynth 64bit plugins folder.

Edit: I figured it out. I had downloaded the portable vaporsynth, and I didn't realize the files for the editor would have to go in the same folder.

Zarxrax
13th February 2022, 17:31
As someone with no experience with C++ programming, could someone tell me what all is required to build and modify this project? I would like to start learning and play around with it, but not sure how to start.

lansing
10th April 2022, 05:50
Update to version R6.7 (https://bitbucket.org/gundamftw/vapoursynth-editor-2/downloads/)

simplified changelog

- Added a RGB parade scope to the scope dialog
- Bug fix: grayscale video causing program crash
- Some file and classes renaming to avoid confusion
- Added an beta drag and drop functionality to open video file in new script


A long waited renaming to me is done. No more slotReceiveFrame and receiveFrame function which confused the heck out of me when debugging.

An unpolished RGB parade scope added to the scope dialog, you can now switch between waveform monitor and RGB parade scopes. One issue though is the memory usage. One my 1080p video, the waveform monitor uses about 80 MB while the RGB parade uses about 300 MB. I'm suspecting the reason to be because I'm doing the scale down using Qts' scale function instead of during the script. That'll have to be find out later.

Also I added a drag and drop functionality for video to directly input it into a template script ready for preview. The purpose with this is to make simple tasks like opening a video just to check on stuff as fast as possible like Avspmod. No keyboard intervention, you simply drag and drop a video into the program and it will open as a new script and you click preview, everything done in 2 clicks. Right now the template is hard coded for testing with only "mp4, mkv, mov" as detected extension. There is a "file drop template" function in the program but that was more like an "in-script file drop" rather than "file drop to new script." I'll see if I can merge both into one.

lansing
10th April 2022, 23:27
I think the current "file drop template" system needs to go. Its usage is too loose to a point that nobody knows what to do with it. The general use of the file drop functionality in a script should be just to insert a template script for opening media files with a source filter. The "category" field serves no purpose except for grouping of file extensions that share a similar template, which is not user friendly for searching.

~ VEGETA ~
21st April 2022, 00:24
I am using latest vapoursynth and vsedit 2 with python 3.10.4 but still vsedit 2 crashes after pressing preview. I noticed it detects script errors when they happen and even make lsmash index file when pressing preview, but when it needs to output the video it crashes.

I am on windows 10.

lansing
22nd April 2022, 07:52
I am using latest vapoursynth and vsedit 2 with python 3.10.4 but still vsedit 2 crashes after pressing preview. I noticed it detects script errors when they happen and even make lsmash index file when pressing preview, but when it needs to output the video it crashes.

I am on windows 10.

Probably missing plugins for the preview filters.

My fork of the vapoursynth-histogram (https://github.com/gundamftw/vapoursynth-histogram/releases)
The Akarin (https://github.com/AkarinVS/vapoursynth-plugin/releases) plugin.

~ VEGETA ~
26th April 2022, 18:24
Probably missing plugins for the preview filters.

My fork of the vapoursynth-histogram (https://github.com/gundamftw/vapoursynth-histogram/releases)
The Akarin (https://github.com/AkarinVS/vapoursynth-plugin/releases) plugin.

ok but which ones? how can I know?

the same scripts work fine with vsedit 1.

Julek
26th April 2022, 19:43
ok but which ones? how can I know?

the same scripts work fine with vsedit 1.

As described here (https://forum.doom9.org/showthread.php?p=1919799#post1919799), you need both to use vsedit 2

About the various akarin versions, they all have Expr, so you can choose any one, what changes are the cuda filters.

~ VEGETA ~
30th April 2022, 15:11
Now it worked fine after installing those plugins. thanks.

however, I really like to know how to move between scenes using shortcuts or so. please advise.

lansing
30th April 2022, 20:56
however, I really like to know how to move between scenes using shortcuts or so. please advise.

The program doesn't have such function. I think it can be achieved by looking for the next I-frame in the output, but I don't know how is the performance when doing it on the fly.

Tima
30th April 2022, 22:59
@lansing -- could you pls add an option to disable "UV plane contrast boost" feature to be able to see untouched planes?

~ VEGETA ~
1st May 2022, 01:27
I managed to get bookmarks via that python script vsbookmark but I'd like to see how to do this:

1- get these bookmarks to show at timeline.

2- use shortcuts to move between them.

thanks

lansing
1st May 2022, 20:15
@lansing -- could you pls add an option to disable "UV plane contrast boost" feature to be able to see untouched planes?

Do you have a reason for that? From my experience, the UV planes are good to let people test their denoiser settings on those planes. However without the contrast boost, they would be so washed out that you couldn't really see anything. As of now, you can remove the akarin plugin and the program will fall back to the regular UV planes display.

Tima
4th May 2022, 04:59
Do you have a reason for that? From my experience, the UV planes are good to let people test their denoiser settings on those planes. However without the contrast boost, they would be so washed out that you couldn't really see anything.

The contrast jumps back and forth between consecutive frames -- this is really confusing.

Also, one might need to look at exact UV planes content for reasons other than denoising :)

Blue_MiSfit
6th May 2022, 00:50
Any plans to make this friendlier with DPI scaling? I run 150% and the widgets get pretty messed up :)

~ VEGETA ~
13th May 2022, 00:13
I managed to get bookmarks via that python script vsbookmark but I'd like to see how to do this:

1- get these bookmarks to show at timeline.

2- use shortcuts to move between them.

thanks

still no answer to my questions. what do you think about them, especially number 2 since I got 1 to work.

lansing
15th May 2022, 23:54
still no answer to my questions. what do you think about them, especially number 2 since I got 1 to work.

I don't know what the vsbookmark is, what does it do?

How you tried the bookmark manager in the program?

~ VEGETA ~
16th May 2022, 03:23
I don't know what the vsbookmark is, what does it do?

How you tried the bookmark manager in the program?

vsbookmark is this: https://gist.github.com/OrangeChannel/b9666b3650a3448589069d25dd6a394c

mentioned here: https://guide.encode.moe/encoding/scenefiltering.html

However, this doesn't solve the other issue of not having quick keyboard shortcuts to switching between the bookmarks. what do you say about this? any solution?

if this method is not best, then how to do it via the built-in bookmarks manager?

lansing
16th May 2022, 07:42
vsbookmark is this: https://gist.github.com/OrangeChannel/b9666b3650a3448589069d25dd6a394c

mentioned here: https://guide.encode.moe/encoding/scenefiltering.html

However, this doesn't solve the other issue of not having quick keyboard shortcuts to switching between the bookmarks. what do you say about this? any solution?

if this method is not best, then how to do it via the built-in bookmarks manager?

The bookmark manager can take in chapter file or text file with number separated by a delimiter. Go into settings->common->bookmark saving settings, check "bookmark" and change delimiter to a comma, then you can load in the text file created by that "generate()" from the vsbookmark script in the bookmark manager. You can jump to certain bookmark by double clicking it.

Highlighting 300+ bookmarks on the timeline though is a big no no, as it will just turn the timeline into a big mess like the original vsedit.

What kind of shortcut are you looking for? I haven't put a lot of thought into it since nobody ask for them.

~ VEGETA ~
16th May 2022, 21:19
it didn't work. I generated the bookmarks then opened it and saved it as txt file. when I load it inside vsedit2 it doesn't appear.

Some other times they appear... so I don't know what is going on.

can you kindly test it yourself ?

Yomiko
19th May 2022, 17:04
HIDPI still sounds like a mistake

jlw_4049
18th February 2024, 19:12
Latest version R6.5, R6.7 randomly will just disappear when previewing a script. This problem doesn't happen on R6.4 and lower. Tested across 3 machines with the proper portable setup with the required plugins.

Comment code doesn't work on any of them with the hotkey