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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th February 2018, 23:05   #2961  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Selur View Post
@Myrsloik: Any change for a fixed portable 64bit version?
Maybe later. Report some more bugs so I'll have to make a full release...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 9th February 2018, 03:27   #2962  |  Link
cwk
Registered User
 
Join Date: Jan 2004
Location: earth, barely
Posts: 96
Have the inpand and expand functions been ported to Vapoursynth? I'm looking to run a dehalo script on linux, so using the Avisynth repair dll is a no go.
cwk is offline   Reply With Quote
Old 9th February 2018, 04:26   #2963  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 162
Quote:
Originally Posted by cwk View Post
Have the inpand and expand functions been ported to Vapoursynth? I'm looking to run a dehalo script on linux, so using the Avisynth repair dll is a no go.
inpand:
core.std.Minimum

expand:
core.std.Maximum
WolframRhodium is offline   Reply With Quote
Old 9th February 2018, 05:45   #2964  |  Link
cwk
Registered User
 
Join Date: Jan 2004
Location: earth, barely
Posts: 96
Many thanks Wolfram.
cwk is offline   Reply With Quote
Old 9th February 2018, 21:35   #2965  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
If i need some quite big buffer (for 4k content about 100mb) in my plugin and don't want to allocate via malloc at every frame and instead allocate at filter instantiation, how can i do it?
MonoS is offline   Reply With Quote
Old 9th February 2018, 22:50   #2966  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by MonoS View Post
If i need some quite big buffer (for 4k content about 100mb) in my plugin and don't want to allocate via malloc at every frame and instead allocate at filter instantiation, how can i do it?
Is the allocation actually slowing you down a lot? Have you benchmarked it?
TheFluff is offline   Reply With Quote
Old 9th February 2018, 23:30   #2967  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by MonoS View Post
If i need some quite big buffer (for 4k content about 100mb) in my plugin and don't want to allocate via malloc at every frame and instead allocate at filter instantiation, how can i do it?
Make it parallelrequests. Allocate it once in the constructor. See if less parallelism even matters?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 10th February 2018, 00:19   #2968  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Code:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# Loading F:\TestClips&Co\files\Test-AC3-5.1.avi using FFMS2
clip = core.ffms2.Source(source="F:/TESTCL~1/files/TEST-A~1.AVI",cachefile="H:/Temp/avi_4a88093b3b83d19d00642a5a96b0af78_41.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg")
# Making sure input color range is set to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# Loading F:\TestClips&Co\files\Subtitles\Appa 7 Arb done.ass using SubText
clip = core.sub.TextFile(clip=clip, file="F:/TestClips&Co/files/Subtitles/Appa 7 Arb done.ass", fontdir="G:/Hybrid/settings/fonts")
# adjusting output color from: RGB24 to YUV420P10 for x265Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg")
# Output
clip.set_output()
gives me:
Code:
Error getting the frame number 0:
Resize error: Resize error 3074: no path between colorspaces (2/2/2 => 5/2/2). May need to specify additional colorspace parameters.
Seems like I'm missing some additional colorspace parameters, but which?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 10th February 2018, 01:40   #2969  |  Link
VS_Fan
Registered User
 
Join Date: Jan 2016
Posts: 98
Code:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", matrix_in_s="470bg")
edit: or simply:
Code:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)

Last edited by VS_Fan; 10th February 2018 at 01:46.
VS_Fan is offline   Reply With Quote
Old 10th February 2018, 06:49   #2970  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Thanks
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 10th February 2018, 17:22   #2971  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by TheFluff View Post
Is the allocation actually slowing you down a lot? Have you benchmarked it?
I can't quantify it precisely, but i guess about 5/10%

Quote:
Originally Posted by Myrsloik View Post
Make it parallelrequests. Allocate it once in the constructor. See if less parallelism even matters?
With ParallelRequests it's about 20% slower.
MonoS is offline   Reply With Quote
Old 11th February 2018, 00:30   #2972  |  Link
Stephen R. Savage
Registered User
 
Stephen R. Savage's Avatar
 
Join Date: Nov 2009
Posts: 327
You can store the buffer per-thread. Allocate the buffer on first use.

Code:
std::map<std::thread::id, std::shared_ptr<void>> per_thread_buffer;

/* ... */ get_frame(/* ... */)
{
    void *buf = per_thread_buffer[std::this_thread::get_id()].get();
    // ...
}
You can also use VSAPI::newVideoFrame to allocate memory. The allocation is cached in the frame buffer pool.

Code:
/* ... */ get_frame(/* ... */, VSCore *core, VSAPI *vsapi)
{
    const int buffer_size = /* ... */;
    VSFrameRef *buf_frame = vsapi->newVideoFrame(vsapi->getFormatPreset(pfGray8, core), buffer_size, 1, nullptr, core);
    void *buf = vsapi->getReadPtr(buf_frame, 0);
    // ...
    vsapi->freeFrame(buf_frame);    
}

Last edited by Stephen R. Savage; 11th February 2018 at 00:35.
Stephen R. Savage is offline   Reply With Quote
Old 11th February 2018, 11:49   #2973  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by Stephen R. Savage View Post
You can store the buffer per-thread. Allocate the buffer on first use.

Code:
std::map<std::thread::id, std::shared_ptr<void>> per_thread_buffer;

/* ... */ get_frame(/* ... */)
{
    void *buf = per_thread_buffer[std::this_thread::get_id()].get();
    // ...
}
You can also use VSAPI::newVideoFrame to allocate memory. The allocation is cached in the frame buffer pool.

Code:
/* ... */ get_frame(/* ... */, VSCore *core, VSAPI *vsapi)
{
    const int buffer_size = /* ... */;
    VSFrameRef *buf_frame = vsapi->newVideoFrame(vsapi->getFormatPreset(pfGray8, core), buffer_size, 1, nullptr, core);
    void *buf = vsapi->getReadPtr(buf_frame, 0);
    // ...
    vsapi->freeFrame(buf_frame);    
}
i tried the first solution and i got about 5% of performance, thanks
MonoS is offline   Reply With Quote
Old 28th February 2018, 15:51   #2974  |  Link
kriNon
Registered User
 
Join Date: Jul 2016
Posts: 39
Could someone please explain how to get the OCR plugin working? Supposedly it's meant to be an included plugin, however my installation doesn't have any corresponding dll file. I've taken a look at five or so of the latest vapoursynth releases on github and none of them have included the dll for the ocr plugin.
kriNon is offline   Reply With Quote
Old 28th February 2018, 17:37   #2975  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
1st time I hear of an ocr plugin for Vapoursynth,...
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 1st March 2018, 02:15   #2976  |  Link
kriNon
Registered User
 
Join Date: Jul 2016
Posts: 39
Yeah, supposedly it exists according to: www.vapoursynth.com/doc/plugins/ocr.html
Can't find any documentation on getting it setup and working though as it doesn't seem to come with vapoursynth from what I can tell
kriNon is offline   Reply With Quote
Old 1st March 2018, 11:33   #2977  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by kriNon View Post
Yeah, supposedly it exists according to: www.vapoursynth.com/doc/plugins/ocr.html
Can't find any documentation on getting it setup and working though as it doesn't seem to come with vapoursynth from what I can tell
Nobody ever bothered to make a windows compile of it. That's mostly the problem. I'll poke someone and include it the next release.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 14th March 2018, 01:10   #2978  |  Link
Hrxn
Registered User
 
Join Date: Mar 2016
Posts: 19
Short question regarding the documentation:

From the Windows Portable Instructions

Quote:
Simply decompress the portable VapourSynth archive into the Python dir and overwrite all existing files. Done.

You can also use the VapourSynth Editor by decompressing it into the same directory.
Extracting VapourSynth64-Portable-Rxx.7z to "Python dir", as in the directory of the Python system installation?

The usual default is XXXX\AppData\Local\Programs\Python\Python36

.. and the VapourSynth Editor should be extracted into this directory as well?

There isn't another way to do this? Without tampering with my Python install dir?
Hrxn is offline   Reply With Quote
Old 14th March 2018, 01:23   #2979  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
I use a portable Vapoursynth and Pyhton in Hybrid.
I downloaded the portable Vapoursynth and extracted the portable Python into the Vapoursynth folder, into which I also extracted vsedit, works all fine.
If you got a system wide Python installed no moving of the portable version or vsedit is required iirc.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 18th March 2018, 19:57   #2980  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I wrote a small "vs plugin loading checker" script and got some errors...
What does "No entry point found" mean exactly? CombMask should be a vs dll.
Error 193 means it's a 32Bit dll, correct?

Is it possible to not autoload all plugins when using get_core()?

Quote:
#######################################
VapourSynth Video Processing Library
Copyright (c) 2012-2018 Fredrik Mellbin
Core R43
API R3.5
Options: -

#######################################
checking dlls in E:\PortableApps\VapourSynth\plugins64
#######################################
Failed to load E:\PortableApps\VapourSynth\plugins64\bilateralGPU.dll. GetLastError() returned 126. A DLL dependency is probably missing.
No entry point found in E:\PortableApps\VapourSynth\plugins64\CombMask.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\cudart64_80.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\externalfilters.dll. GetLastError() returned 193.
No entry point found in E:\PortableApps\VapourSynth\plugins64\libfftw3-3.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\libfftw3f-3.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\libIlmImf.dll. GetLastError() returned 126. A DLL dependency is probably missing.
No entry point found in E:\PortableApps\VapourSynth\plugins64\libiomp5md.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\libmfxsw64.dll
Plugin load failed, namespace focus already populated (E:\PortableApps\VapourSynth\plugins64\libtemporalsoften.dll)
No entry point found in E:\PortableApps\VapourSynth\plugins64\ReduceFlicker.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\scenechange.dll. GetLastError() returned 193.
No entry point found in E:\PortableApps\VapourSynth\plugins64\svml_dispmd.dll
Failed to load E:\PortableApps\VapourSynth\plugins64\tc2cfr.dll. GetLastError() returned 193.
Failed to load E:\PortableApps\VapourSynth\plugins64\temporalsoften2.dll. GetLastError() returned 193.
No entry point found in E:\PortableApps\VapourSynth\plugins64\w2xc.dll
No entry point found in E:\PortableApps\VapourSynth\plugins64\XySubFilter.dll
#######################################
Found 103 dlls. Errors: 17

Code:
import sys, os, glob
import vapoursynth as vs


def print_version(core):
	vs_version = core.version()
	print('#######################################')
	print(vs_version)
	print('#######################################')


def main(argv):
	if(len(sys.argv) > 1):
		path = argv[1]
	else:
		exit("\n\rUsage: vs_plugin_check.py <path-to-vapoursynth-plugins-folder>\n\r")
	
	core = vs.get_core()
	print_version(core)
	
	plugin_dir = glob.glob(path + '/*.dll')
	
	print("checking dlls in", path)
	print('#######################################')
	
	error_count = 0
	for dll in plugin_dir:
		cnt += 1
		try:
			core.std.LoadPlugin(path=dll)
		except Exception as e:
			if "already loaded" not in str(e):
				error_count += 1
				print(e)
		
	print('#######################################')
	print("Found", len(plugin_dir), "dlls. Errors:", error_count)
	print()


if __name__ == "__main__":
	main(sys.argv)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 18th March 2018 at 20:06.
ChaosKing is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth


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 09:41.


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