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 26th August 2021, 23:13   #81  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
How do I get a map of functions from a plugin in api4?

Code:
VSMap * FunctionsMap = VSAPI->getFunctions(Plugin);
lansing is offline   Reply With Quote
Old 26th August 2021, 23:51   #82  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
How do I get a map of functions from a plugin in api4?

Code:
VSMap * FunctionsMap = VSAPI->getFunctions(Plugin);
Use getNextPluginFunction(plugin, nullptr)
Then pass the returned pointer to the function until it returns null. That means you've enumerated all plugins.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th August 2021, 00:22   #83  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Myrsloik View Post
Use getNextPluginFunction(plugin, nullptr)
Then pass the returned pointer to the function until it returns null. That means you've enumerated all plugins.
Like this? Do I need to free the function every loop before getting a new one?

Code:
VSPluginFunction * function = VSAPI->getNextPluginFunction(nullptr, Plugin);
        
while (function != nullptr) {
    # do stuff with function
    function = VSAPI->getNextPluginFunction(nullptr, Plugin);
}
lansing is offline   Reply With Quote
Old 27th August 2021, 00:51   #84  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Correct, you don't have to free anything.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th August 2021, 07:17   #85  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
What does the argument string returned by "vsapi->getPluginFunctionArguments(function)" look like? I didn't see any example in the api
lansing is offline   Reply With Quote
Old 27th August 2021, 20:27   #86  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
How do I get the videoFormat name and uses it in one line like in api3?

Code:
myFunction(videoInfo->format.name);
lansing is offline   Reply With Quote
Old 27th August 2021, 20:55   #87  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
How do I get the videoFormat name and uses it in one line like in api3?

Code:
myFunction(videoInfo->format.name);
One line?
Code:
char name[32]; vsapi->getVideoFormatName(&videoInfo.format, name); myFunction(name);
But more seriously, use a lambda or something if you need it many times in the same function.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 27th August 2021 at 21:21.
Myrsloik is offline   Reply With Quote
Old 27th August 2021, 21:21   #88  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by _Al_ View Post
Using that latest API4 R 55 portable RC1 version with latest portable python 3.9 on windows 7, running VSPipe.exe I get:
Code:
The program can't start because api-ms-win-core-path-|1-1-0.dll is missing from computer. Try reinstalling the program to fix this problem.
What do i have outdated? Older R51 portable is working.
Do I need Visual Studio 2019 for portable setup?
Install the most recent vs2019 runtime manually.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th August 2021, 22:03   #89  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Myrsloik View Post
One line?
But more seriously, use a lambda or something if you need it many times in the same function.
This is another use case in api3:
Code:
infoString.replace("%format%", videoInfo->format.name);
lansing is offline   Reply With Quote
Old 28th August 2021, 05:05   #90  |  Link
Yomiko
Registered User
 
Join Date: Aug 2021
Posts: 73
core.add_cache is removed (although remains in the doc). May I know about a replacement for it?
Yomiko is offline   Reply With Quote
Old 28th August 2021, 10:26   #91  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Yomiko View Post
core.add_cache is removed (although remains in the doc). May I know about a replacement for it?
Cache insertion is now handled by the core so there's no direct replacement. If you want to change the automatic decision to add a lot of caching on your output simply use the SeVideoCache/SetAudioCache functions.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 28th August 2021, 11:47   #92  |  Link
Yomiko
Registered User
 
Join Date: Aug 2021
Posts: 73
Thanks. Also I see all the arguments are required in these functions. Is it as intended?
Yomiko is offline   Reply With Quote
Old 28th August 2021, 12:02   #93  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Yomiko View Post
Thanks. Also I see all the arguments are required in these functions. Is it as intended?
No, they should obviously be optional
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th August 2021, 03:40   #94  |  Link
Yomiko
Registered User
 
Join Date: Aug 2021
Posts: 73
Code:
>>> import vapoursynth as vs
>>> core = vs.core
>>> clip = core.std.BlankClip(width=1921, height=1081, format=vs.RGB48)
>>> frame = clip.get_frame(2)
>>> frame[0] == frame[2]
True
>>> frame[0] == frame[1]
True
>>> frame = clip.get_frame(22)
>>> frame[0]
<memory at 0x0000021EE196B930>
>>> frame[1]
<memory at 0x0000021EE196B860>
>>> frame[2]
<memory at 0x0000021EE196B930>
>>>
Is it as intended in R55-RC1?

Last edited by Yomiko; 30th August 2021 at 03:43.
Yomiko is offline   Reply With Quote
Old 30th August 2021, 07:19   #95  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Yomiko View Post
Code:
>>> import vapoursynth as vs
>>> core = vs.core
>>> clip = core.std.BlankClip(width=1921, height=1081, format=vs.RGB48)
>>> frame = clip.get_frame(2)
>>> frame[0] == frame[2]
True
>>> frame[0] == frame[1]
True
>>> frame = clip.get_frame(22)
>>> frame[0]
<memory at 0x0000021EE196B930>
>>> frame[1]
<memory at 0x0000021EE196B860>
>>> frame[2]
<memory at 0x0000021EE196B930>
>>>
Is it as intended in R55-RC1?
Yes, it's how you access plane data now
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd September 2021, 10:09   #96  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
RC2 posted. Changes:
  • Reworked vsscript api to restore api3 functionality
  • AVFS fixes (packed RGB in Avisynth scripts)
  • Uses new and faster libp2p for packing
  • Removed lots of Python functions that have been deprecated since at least R51
  • API4 headers actually included in installer

Things you can do to help:
  • Update the __all__ tag in vapoursynth.pyx with all relevant symbols
  • Create vsscript4.h.rst and vshelper4.h.rst (these are simple and work 99% like the api3 counterparts)
  • Review pythonreference.rst (mostly updated by me already but probably missing some functions)
  • Review all other documentation.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd September 2021, 15:57   #97  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
The VSVideoFormat argument of isSameVideoPresetFormat() is missing the "constant" declaration?
lansing is offline   Reply With Quote
Old 2nd September 2021, 17:50   #98  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
The VSVideoFormat argument of isSameVideoPresetFormat() is missing the "constant" declaration?
Correct. Will be fixed.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd September 2021, 20:45   #99  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
was the vs.set_option('alt_output', X) removed from RC2 ?
poisondeathray is offline   Reply With Quote
Old 2nd September 2021, 21:05   #100  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by poisondeathray View Post
was the vs.set_option('alt_output', X) removed from RC2 ?
Yes, now alt_output is an optional argument to set_output(). Makes more sense that way.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Reply

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 17:15.


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