Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd February 2021, 05:27   #4181  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
plugin path: https://github.com/IFeelBloated/vsFi...Plugin.vxx#L59
script path: https://github.com/IFeelBloated/Vapo...orMagik.py#L71
feisty2 is offline   Reply With Quote
Old 2nd February 2021, 11:52   #4182  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Quote:
Originally Posted by lansing View Post
Can I retrieve the paths for the vs plugin folder and script folder through the api?
The script "folder" isn't a single folder but simply all the normal python import paths. You can see vsrepo.py to see how it's determined by default I guess.

The "vs plugin folder" is also harder to determine. Basically you have 3 locations:
1. The core plugins
2. The global plugins
3. User plugins

The location of 2 is written to the registry and 3 is always in the same appdata location. Why do you even need to find out where things are?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd February 2021, 12:09   #4183  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Myrsloik View Post
The script "folder" isn't a single folder but simply all the normal python import paths. You can see vsrepo.py to see how it's determined by default I guess.

The "vs plugin folder" is also harder to determine. Basically you have 3 locations:
1. The core plugins
2. The global plugins
3. User plugins

The location of 2 is written to the registry and 3 is always in the same appdata location. Why do you even need to find out where things are?
I want to create links in vseditor to open them in one click. Right now I’m relying on vsrepogui, but when vsrepogui didn’t work, it’ll be a pain to look for them manually.
lansing is offline   Reply With Quote
Old 2nd February 2021, 12:28   #4184  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
For plugins http://www.vapoursynth.com/doc/plugins.html#windows
vsrepogui just uses the paths provided by vsrepo.

But registry can be tricky if the user has installed 32bit vapoursynth or it is a "per user installation".

I need to check 4 locations in vsrepogui to cover all cases.

Code:
            var regl32 = new VsRegistry().GetRegistry(localKey32, @"SOFTWARE\VapourSynth-32");
            var regl64 = new VsRegistry().GetRegistry(localKey64, @"SOFTWARE\VapourSynth");

            var regu32 = new VsRegistry().GetRegistry(userKey32, @"SOFTWARE\VapourSynth-32");
            var regu64 = new VsRegistry().GetRegistry(userKey64, @"SOFTWARE\VapourSynth");
localKey* => RegistryHive.LocalMachine
userKey* => RegistryHive.CurrentUser


EDIT
vsrepo code for scripts

https://github.com/vapoursynth/vsrep...vsrepo.py#L186
Code:
import site
site_package_dir = site.getusersitepackages()
Which returns C:\Users\USER\AppData\Roaming\Python\Python38\site-packages
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 2nd February 2021 at 12:42.
ChaosKing is offline   Reply With Quote
Old 2nd February 2021, 13:21   #4185  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
User plugin should be all I need. I think I’ll just call vsrepo to open them.
lansing is offline   Reply With Quote
Old 3rd February 2021, 19:57   #4186  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
How should such a video be indexed?
Code:
Format                                   : AVI
Format/Info                              : Audio Video Interleave
Commercial name                          : DV
Format profile                           : OpenDML
Overall bit rate mode                    : Constant
Overall bit rate                         : 30 Mb/s

Video
ID                                       : 0
Format                                   : DV
Codec ID                                 : dvsd
Codec ID/Hint                            : Sony
Bit rate mode                            : Constant
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Original frame rate                      : 29.970 (29970/1000) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:1:1
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Bottom Field First
Compression mode                         : Lossy
Jukus is offline   Reply With Quote
Old 3rd February 2021, 20:04   #4187  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
You can open that with ffms2 or L-Smash-Source.
stax76 is offline   Reply With Quote
Old 3rd February 2021, 21:39   #4188  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,780
Disadvantage: Because it is a "keyframe only" video format, the index will be huge and indexing will take a lot of time.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Old 3rd February 2021, 21:47   #4189  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
If you're on windows, you can open it up with core.avisource.AVISource without indexing. Disadvantage - requires system installed DV codec and none that I know of return the original NTSC 4:1:1 .
poisondeathray is offline   Reply With Quote
Old 4th February 2021, 13:40   #4190  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
does anyone actually need half precision (fp16) facilities and does any plugin actually provide support for it? I don't really wanna have it in my project and I have very good reasons:

1) there's no native support for fp16 in standard C/C++ and most CPUs provide very little or no support for it, meaning you will have to create your homegrown software-emulated fp16 type. it's not portable and it's very likely that it will be way slower than fp32 which comes with native hardware support.

2) unlike fp32 and fp64 which are universally well defined (literally every implementation out there adopts the representation defined by IEEE 754), the representation of fp16 varies on different platforms. there's the IEEE fp16, and BFloat16 (Google TPU), and who knows what else! applying arithmetic operations defined for one fp16 representation on another fp16 representation leads to garbage result. The user (or maybe even the developer) usually has absolutely no clue which fp16 representation is being used and all sorts of weird shit can happen. It might be better to avoid all this by simply not supporting fp16.
feisty2 is offline   Reply With Quote
Old 4th February 2021, 13:44   #4191  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Quote:
Originally Posted by feisty2 View Post
does anyone actually need half precision (fp16) facilities and does any plugin actually provide support for it? I don't really wanna have it in my project and I have very good reasons:

1) there's no native support for fp16 in standard C/C++ and most CPUs provide very little or no support for it, meaning you will have to create your homegrown software-emulated fp16 type. it's not portable and it's very likely that it will be way slower than fp32 which comes with native hardware support.

2) unlike fp32 and fp64 which are universally well defined (literally every implementation out there adopts the representation defined by IEEE 754), the representation of fp16 varies on different platforms. there's the IEEE fp16, and BFloat16 (Google TPU), and who knows what else! applying arithmetic operations defined for one fp16 representation on another fp16 representation leads to garbage result. The user (or maybe even the developer) usually has absolutely no clue which fp16 representation is being used and all sorts of weird shit can happen. It might be better to avoid all this by simply not supporting fp16.
1. That's not how you do it. You use the unpack/pack instructions for fp16 for load and store and then feed that to the normal fp32 path. It's the only way to make it perform well.

2. Obviously it's whatever the cpu native fp16 format is, just like with other floats. So IEEE all the way on x86 (and just about all sane cpus).

Support is mostly pointless.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th February 2021, 17:46   #4192  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
Quote:
Originally Posted by LigH View Post
Disadvantage: Because it is a "keyframe only" video format, the index will be huge and indexing will take a lot of time.
The file weighs over 30 gb
Duration over 02:30:00
The size of the ffms index is 50+ kb
Jukus is offline   Reply With Quote
Old 5th February 2021, 11:16   #4193  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
What function do I use to retrieve warning message from the api? If I run a script with clip = core.get_core() in PyCharm it'll give me a nice deprecated warning, but in vseditor I couldn't find a function that can do that. the getError() only return on fatal error like frame failed to load.
lansing is offline   Reply With Quote
Old 5th February 2021, 11:26   #4194  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
https://github.com/vapoursynth/vapou...ynth.pyx#L2337
it has nothing to do with VS per se. you just have to find a way to utilize python's warnings module in your application.
feisty2 is offline   Reply With Quote
Old 5th February 2021, 23:12   #4195  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,780
@Jukus: OK, maybe it's worse with uncompressed audio. My memories may be not completely correct in this case.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Old 6th February 2021, 01:36   #4196  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by feisty2 View Post
https://github.com/vapoursynth/vapou...ynth.pyx#L2337
it has nothing to do with VS per se. you just have to find a way to utilize python's warnings module in your application.
I don't really know what to do. Maybe like embedding Python into my vseditor project and then have it evaluate the script so I can catch the warning?
lansing is offline   Reply With Quote
Old 6th February 2021, 08:20   #4197  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
you can use vaporsynth's FFI facilities to execute arbitrary python code in your C++ programs. you need to:
1) define a python function that does what you want, in this case, the function should collect all warning messages from warnings and return them as a list of strings.
2) pass the function to a special filter and execute it, in this case, you can instantly execute the acquired function in your filter's constructor, then call Core.Alert() to send all warning messages to console.
feisty2 is offline   Reply With Quote
Old 6th February 2021, 17:18   #4198  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by feisty2 View Post
you can use vaporsynth's FFI facilities to execute arbitrary python code in your C++ programs. you need to:
1) define a python function that does what you want, in this case, the function should collect all warning messages from warnings and return them as a list of strings.
2) pass the function to a special filter and execute it, in this case, you can instantly execute the acquired function in your filter's constructor, then call Core.Alert() to send all warning messages to console.
What is vaporsynth's FFI facilities?
lansing is offline   Reply With Quote
Old 6th February 2021, 17:40   #4199  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by lansing View Post
What is vaporsynth's FFI facilities?
https://github.com/IFeelBloated/vsFi...e/Function.vxx

and use it to run python code thru a special filter
Code:
struct PythonEval {
	static constexpr auto Name = "PythonEval";
	static constexpr auto Signature = "code:func;";

	PythonEval(auto Arguments, auto Core) {
		for (auto PythonCode = static_cast<Function>(Arguments["code"]); auto&& WarningMessage : PythonCode())
			Core.Alert(static_cast<std::string>(WarningMessage));
	}
};
feisty2 is offline   Reply With Quote
Old 7th February 2021, 07:51   #4200  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
This is what I found to catch the warnings:

Code:
import warnings

with warnings.catch_warnings(record=True) as warning_list:
    core = vs.get_core()
    clip = core.dgdecodenv.DGSource(r'hello.dgi')
    clip.set_output()

for warning in warning_list:
    print(warning.message)
But I need to wrap the whole script inside this warnings.catch_warnings in order to catch them.
lansing is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.