Log in

View Full Version : VapourSynth Editor 2


Pages : [1] 2 3 4 5 6 7

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.