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 11th November 2013, 18:28   #1061  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by mastrboy View Post
There's a speed difference between SCSelect and using Avisynth's built-in runtime functions (xDifferenceFromPrevious/xDifferenceToNext), SCSelect is quite faster, no idea if the same would apply to vapoursynth's internal functions though...
I think most of the speed difference is because avisynth recalculates the metric for both frames if you use scriptclip and friends. In vapoursynth the metric would be attached to frames and cached.

Experimentation welcome. Just keep in mind i didn't write any asm for the vapoursynth functions planedifference and planeaverage yet so for now it will be slightly slower.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 11th November 2013, 18:34   #1062  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
On latest git from vapoursynth:
Code:
Python 3.3.2 (default, Aug 18 2013, 22:19:13)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vapoursynth as vs
terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error
Aborted
It looks like it's compiler's fault.

Anybody knows if this is supported on other compilers (4.9 looks far away for me)?
Are_ is offline   Reply With Quote
Old 11th November 2013, 20:14   #1063  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Are_ View Post
On latest git from vapoursynth:
Code:
Python 3.3.2 (default, Aug 18 2013, 22:19:13)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vapoursynth as vs
terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error
Aborted
It looks like it's compiler's fault.

Anybody knows if this is supported on other compilers (4.9 looks far away for me)?
I use it for some trivial checks so I'll just rewrite it without regexp. I believe clang implements everything properly. Or you can just wait a day or two and I'll have it unbroken. There are like 0 functionality changes since r21, only cleanups and rewrites.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 11th November 2013, 20:27   #1064  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Nice to know there's an easy fix. Thx
Are_ is offline   Reply With Quote
Old 11th November 2013, 22:24   #1065  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Are_ View Post
Nice to know there's an easy fix. Thx
I should be fixed now, I guess. Report any other new linux issues you find.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 11th November 2013, 23:27   #1066  |  Link
Joachim Buambeki
Registered User
 
Join Date: May 2010
Location: Germany, Munich
Posts: 49
Great work so far Myrsloik. :-)

What about making Vapoursynth OpenFX compatible?
That would open the power of Vapoursynth to a lot of users, professionals and users of the free but powerful Resolve Lite but I am sure users of other apps like Nuke etc. would would also profit from it.

JB

Last edited by Joachim Buambeki; 12th November 2013 at 00:27.
Joachim Buambeki is offline   Reply With Quote
Old 11th November 2013, 23:44   #1067  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
This is a nice idea
kolak is offline   Reply With Quote
Old 12th November 2013, 00:39   #1068  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Joachim Buambeki View Post
Great work so far Myrsloik. :-)

What about making Vapoursynth OpenFX compatible?
That would open the power of Vapoursynth to a lot of users, professionals and users of the free but powerful Resolve Lite but I am sure users of other apps like Nuke etc. would would also profit from it.

JB
To do what exactly? Be a simple source plugin?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th November 2013, 09:09   #1069  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
If I prevent removegrain from building everything works great (also just as an informative note, clang throws the same error at runtime when regex are used).

gcc and clang complain on the new code:
gcc buildlog
Code:
../src/filters/removegrain/clense.cpp:152:19: error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive]
     d.mode = (int)userData;
clang buildlog
Code:
../src/filters/removegrain/clense.cpp:152:14: error: cast from pointer to smaller type 'int' loses information
    d.mode = (int)userData;
             ^~~~~~~~~~~~~
1 error generated.
../src/filters/removegrain/removegrainvs.cpp:1241:3: error: constant expression evaluates to -294912 which cannot be narrowed to type 'uint32_t' (aka 'unsigned int') [-Wc++11-narrowing]
{ -0x8000 * 9, -0x8000 * 9, -0x8000 * 9, -0x8000 * 9 };
  ^~~~~~~~~~~
../src/filters/removegrain/removegrainvs.cpp:1241:3: note: override this message by inserting an explicit cast
{ -0x8000 * 9, -0x8000 * 9, -0x8000 * 9, -0x8000 * 9 };
  ^~~~~~~~~~~
Are_ is offline   Reply With Quote
Old 12th November 2013, 11:57   #1070  |  Link
Joachim Buambeki
Registered User
 
Join Date: May 2010
Location: Germany, Munich
Posts: 49
Quote:
Originally Posted by Myrsloik View Post
To do what exactly? Be a simple source plugin?
I am not sure what you mean with "source plugin", but my idea was to select Vapoursynth as a filter in the host application and then you can open a console or something similar where you can type in the filter effect (without the import video stuff of course because it does that automaticaly).
What would be even cooler if it would be possible if one could create wrappers to directly call a certain filter (script) from Vapoursynth like a regular plugin.

A similar suport for After Effects would be great but that would mean that a separare plugin would have to be written, since AE isn't OpenFX compatible unfortunately.


I can only guess but support for these applications should also speed up development of Vapoursynth alot if communicated through the right channels (forums where those people are - CreativeCow, LiftGammaGain, etc.). There should be a fair amount of pros that would be willing to donate their time to help with development I suppose.

Last edited by Joachim Buambeki; 12th November 2013 at 12:03.
Joachim Buambeki is offline   Reply With Quote
Old 12th November 2013, 14:08   #1071  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
I'm trying to write a VapourSynth Python script function. When I pass an argument as None, I want AviSynth filter to use the default value for that argument. How can I do that? Can I form a string of AviSynth filter call and "Evaluate" it?
__________________
...desu!

Last edited by Mystery Keeper; 12th November 2013 at 14:12.
Mystery Keeper is offline   Reply With Quote
Old 12th November 2013, 14:16   #1072  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Mystery Keeper View Post
I'm trying to write a VapourSynth phyton script function. When I pass an argument as None, I want AviSynth filter to use the default value for that argument. How can I do that? Can I form a string of AviSynth filter call and "Evaluate" it?
Something like this can be done in python:
Code:
d = dict(arg1=1, arg2=2) #args you always set here
if arg3 is not None: # optional arg that shouldn't be set when None
  d['arg3name'] = arg3
clip = core.avs.AvsFunction(**d)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th November 2013, 15:07   #1073  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Awesome! I can actually specify different AND matching arguments for multiple calls that way. Thanks a lot, Myrsloik!
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 12th November 2013, 16:56   #1074  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
1) Is there mt_diff analog for VapourSynth? I can do it like this:
Code:
def absdiff(x, y):
	return min(max(0, 127 + x - y), 255)

diff = core.std.Lut2([a, b], function = absdiff)
But it is bitdepth-specific and likely not very fast.

2) Is there HistogramAdjust analog for VapourSynth, or should we ask the author for port?
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 12th November 2013, 17:06   #1075  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Mystery Keeper View Post
1) Is there mt_diff analog for VapourSynth? I can do it like this:
Code:
def absdiff(x, y):
	return min(max(0, 127 + x - y), 255)

diff = core.std.Lut2([a, b], function = absdiff)
But it is bitdepth-specific and likely not very fast.

2) Is there HistogramAdjust analog for VapourSynth, or should we ask the author for port?
1. No

2. No again
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 11:31   #1076  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
AvsPMod silently crashed after several minutes of experimenting with this script. VirtualDub silently crashed after processing ~120000 of ~150000 frames.
Script uses this function.

Code:
avisynth_plugins_path = 'E:\\avisynth-plugins\\'
vapoursyth_plugins_path = 'E:\\vapoursynth-plugins\\x32\\'

import vapoursynth as vs
import sys
sys.path.append(vapoursyth_plugins_path + 'E:\\vapoursynth-plugins\\py\\')
core = vs.get_core(threads=8)

core.set_max_cache_size(3500)

import os
for filename in os.listdir(vapoursyth_plugins_path):
	if filename[-4:] != '.dll':
		continue
	core.std.LoadPlugin(vapoursyth_plugins_path + filename)

core.avs.LoadPlugin(path = avisynth_plugins_path + 'mvtools2.dll')

core.std.LoadPlugin(path = 'D:\\Programming\\TempLinearApproximate-VapourSynth\\build\\release-x32\\templinearapproximate.dll')

d2vfile = 'F:\\Video to Process\\Riaru Onigokko 2\\VTS_01_1.d2v'

ret = core.d2v.Source(input=d2vfile)

def pcToTv(input):
	c = core.fmtc.resample (clip=input, css="444")
	c = core.fmtc.matrix (clip=c, mats="601", matd="709")
	c = core.fmtc.resample (clip=c, css="420")
	c = core.fmtc.bitdepth (clip=c, bits=8)
	return c

z = pcToTv(ret)

sys.path.append('D:\\Programming\\TempLinearApproximate-VapourSynth\\')
import MCDenoise

tlamc = MCDenoise.MCDenoise()
tlaArguments = dict(radius=2, BlockSize=8, Overlap=4, SubPel=4, SubPelInterp=2, Search=5, SearchParam=2, PelSearch=4, DCT=10, ThSAD=200)
ret = tlamc.TempLinearApproximate(ret, **tlaArguments)
ret = tlamc.TempLinearApproximate(ret, **tlaArguments)
ret = core.f3kdb.F3kdb(ret, dither_algo=2, grainy=0, grainc=0, keep_tv_range=True)

ret = pcToTv(ret)

ret.set_output()

def absdiff(x, y):
	return min(max(0, 127 + x - y), 255)

unfiltered = core.text.Text(z, "unfiltered")
filtered = core.text.Text(ret, "filtered")
stack = core.std.StackHorizontal([unfiltered, filtered])
diffhist = core.std.Lut2([z, ret], function = absdiff)
#diffhist = core.generic.Levels(diffhist, planes=0, gamma = 3)
diffhist = core.text.Text(diffhist, "Difference")
filteredhist = core.generic.Levels(ret, planes=0, gamma = 2)
filteredhist = core.text.Text(filteredhist, "Filtered amplified")
diffstack = core.std.StackHorizontal([diffhist, filteredhist])
compare = core.std.StackVertical([stack, diffstack])
#compare.set_output()
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 15th November 2013, 11:44   #1077  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Mystery Keeper View Post
AvsPMod silently crashed after several minutes of experimenting with this script. VirtualDub silently crashed after processing ~120000 of ~150000 frames.
Script uses this function.
Did you notice anything like the memory use going up or the script getting slower over time?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 11:50   #1078  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
The processing speed fluctuates relatively much. 5-11 FPS. But I don't know about the time when it crashed. Is there a way to profile at least the memory use without having to constantly monitor it? Is it possible to have on demand FPS and memory usage profiling and logging functionality in VapourSynth?
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 15th November 2013, 11:55   #1079  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Mystery Keeper View Post
The processing speed fluctuates relatively much. 5-11 FPS. But I don't know about the time when it crashed. Is there a way to profile at least the memory use without having to constantly monitor it? Is it possible to have on demand FPS and memory usage profiling and logging functionality in VapourSynth?
Never mind. I saw that you sneakily put a dll of TLA there.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 15th November 2013 at 11:55. Reason: Missed the TLA dll
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 11:59   #1080  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Right, sorry. Restarted the encode with memory limit changed to 2500. 9K frames so far. Memory usage isn't going over 840MB, but IS slowly rising.
Update: 100000 frames. Still the same fluctuating bitrate. Memory usage still not going over 840MB.
__________________
...desu!

Last edited by Mystery Keeper; 15th November 2013 at 15:23.
Mystery Keeper 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 19:55.


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