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 15th November 2013, 16:03   #1081  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Mystery Keeper View Post
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.
You are running it from a command prompt, right? That way it will usually at least print a fatal error message to stderr. It could be that it simply went over the limit very shortly. I would never try to run it with a memory limit over 2GB since that's only the limit for when memory begins to get reclaimed. Combined with allocations inside filters you're still dangerously close to 3GB if you set it to 2.5GB.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 15th November 2013 at 16:26.
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 16:46   #1082  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Nope. I'm simply encoding it in VirtualDub GUI. Right now it is over 145000 frames, and is still using around 830MB. No idea why it would crash back then.
Update. It has suddenly and silently crashed again.
__________________
...desu!

Last edited by Mystery Keeper; 15th November 2013 at 16:56.
Mystery Keeper is offline   Reply With Quote
Old 15th November 2013, 17:04   #1083  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Mystery Keeper View Post
Nope. I'm simply encoding it in VirtualDub GUI. Right now it is over 145000 frames, and is still using around 830MB. No idea why it would crash back then.
Update. It has suddenly and silently crashed again.
Try doing the encoding with vspipe next time. That way you'll most likely see the fatal error printed. I'm going to try your script now myself and see what happens...
What's the resolution of your source?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 17:06   #1084  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Quite ordinary 720x480 NTSC DVD.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 15th November 2013, 18:02   #1085  |  Link
handaimaoh
Guest
 
Posts: n/a
RemovePort is now done being ported and converted to intrinsics. If you want to test it out a binary is here. I have not really tested it much so far so please let me know of any issues.

A simple Vapoursynth script to test would look like the following if your clip is not greyscale:

Code:
clip = core.ffms2.Source(src)
cleansed = core.rgvs.Clense(clip)
sbegin = core.rgvs.ForwardClense(clip)
send = core.rgvs.BackwardClense(clip)
scenechange = core.vsrd.SCSelect(clip, sbegin, send, cleansed)
alt = core.rgvs.Repair(scenechange, clip, mode=[16,16,1])
restore = core.rgvs.Repair(cleansed, clip, mode=[16,16,1])
corrected = core.vsrd.RestoreMotionBlocks(cleansed, restore, neighbour=clip, alternative=alt, gmthreshold=70, dist=1, dmode=2, noise=10, noisy=12, grey=0)
clip = core.rgvs.RemoveGrain(corrected, mode=[17,17,1])
clip.set_output()
If it is greyscale change the second value in the mode array of ints to -1. A more fancy function will be knocked up later.

Works with only YUV420P8 and YUV422P8 right now.

Last edited by handaimaoh; 16th November 2013 at 02:23.
  Reply With Quote
Old 15th November 2013, 19:21   #1086  |  Link
easyfab
Registered User
 
Join Date: Jan 2002
Posts: 332
I try vapoursynth for the first time. It's a little bit harder than avisynth.
But I succeed to run a script with qtgmc() thanks to aegisofrime script example http://forum.doom9.org/showthread.ph...99#post1649699

although the cpu usage is 100% ( compare to ~50% with my avs script ) the speed is slower for x264 encoding ???
Are some plugins less optimized yet ?

Another question:
Is there a special way to load yadif.dll ? because it doesn't work for me

core.avs.LoadPlugin(path=r'C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll')
core.avs.Load_Stdcall_Plugin(path=r'C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll') ?

And if someone can give me a script example for yadifmod with edeint=nnedi3 It would be nice.

Vapoursynth look promising for the futur, I will keep an eye on it .
easyfab is offline   Reply With Quote
Old 15th November 2013, 19:32   #1087  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by easyfab View Post
I try vapoursynth for the first time. It's a little bit harder than avisynth.
But I succeed to run a script with qtgmc() thanks to aegisofrime script example http://forum.doom9.org/showthread.ph...99#post1649699

although the cpu usage is 100% ( compare to ~50% with my avs script ) the speed is slower for x264 encoding ???
Are some plugins less optimized yet ?

Another question:
Is there a special way to load yadif.dll ? because it doesn't work for me

core.avs.LoadPlugin(path=r'C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll')
core.avs.Load_Stdcall_Plugin(path=r'C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll') ?

And if someone can give me a script example for yadifmod with edeint=nnedi3 It would be nice.

Vapoursynth look promising for the futur, I will keep an eye on it .
Avisynth C plugins can't be loaded. Only normal 2.5 API ones work. Exactly what were your QTGMC and x264 settings when testing it?

QTGMC is known to be a bit slower than when run in avisynth-mt at its best but the difference should be around 15% or so at most.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 19:33   #1088  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Mystery Keeper View Post
Quite ordinary 720x480 NTSC DVD.
Did you overclock your computer or look at the core temperature at all when running the script? Just curious.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 19:46   #1089  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Quote:
Originally Posted by Myrsloik View Post
Did you overclock your computer or look at the core temperature at all when running the script? Just curious.
Nope. Water cooled and not overclocked.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 15th November 2013, 19:49   #1090  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Mystery Keeper View Post
Nope. Water cooled and not overclocked.
Running the script with a blankclip source now. Will see if it can pass 500000 frames in a couple of hours. Days like these I wish I'd gone with a 3770k cpu...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th November 2013, 19:55   #1091  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
That's why I'm saving for two 12 cores Xeons ^_^'
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 15th November 2013, 20:11   #1092  |  Link
easyfab
Registered User
 
Join Date: Jan 2002
Posts: 332
Quote:
Originally Posted by Myrsloik View Post
Avisynth C plugins can't be loaded. Only normal 2.5 API ones work. Exactly what were your QTGMC and x264 settings when testing it?

QTGMC is known to be a bit slower than when run in avisynth-mt at its best but the difference should be around 15% or so at most.
For vapoursynth ( 100% cpu usage )
clip = haf.QTGMC(clip, Preset='slow',TFF=True)
clip = clip[::2]

and for avisynth (~50-60% cpu usage )

setmtmode(2)
QTGMC(preset="slow", EdiThreads=4).selecteven()

x264 --preset slower

And speed is about 20% less with vapoursynth
easyfab is offline   Reply With Quote
Old 15th November 2013, 21:29   #1093  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Quote:
Originally Posted by Myrsloik View Post
Running the script with a blankclip source now. Will see if it can pass 500000 frames in a couple of hours. Days like these I wish I'd gone with a 3770k cpu...
Now I'm curious, what did you get instead?
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 15th November 2013, 21:43   #1094  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by mastrboy View Post
Now I'm curious, what did you get instead?
The 3570k, because at the time I hadn't decided to work on very multithreaded things like VapourSynth. Maybe Intel will give me something better if I ask nicely...

Anyway, next investment will be a very fast graphics card that doesn't sound like a vacuum cleaner.

If someone happens to have a computer with lots of cores I could use remotely to test VapourSynth on that'd be very useful. It's hard for me to test how well things scale on lots of cores with only 4 here.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th November 2013, 00:44   #1095  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Mystery Keeper View Post
Quite ordinary 720x480 NTSC DVD.
506k frames later and it still works. I don't think this method of testing will yield anything. I'll add logging of fatal errors and then let you try that build.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th November 2013, 02:01   #1096  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by handaimaoh View Post
RemovePort is now done being ported and converted to intrinsics. If you want to test it out a binary is here. I have not really tested it much so far so please let me know of any issues.
When I try to load RemoveDirt I get this error:
Quote:
---------------------------
VirtualDub Error
---------------------------
Python exception: 'Failed to load C:\\RemoveDirt.dll'
Traceback (most recent call last):
File "vapoursynth.pyx", line 1082, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:16736)
File "C:\test.vpy", line 4, in <module>
core.std.LoadPlugin(path=r'C:\RemoveDirt.dll')
File "vapoursynth.pyx", line 1005, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:15793)
vapoursynth.Error: 'Failed to load C:\\RemoveDirt.dll'

Also, since clense is now included with RemoveGrainVS shouldn't the script look something like this instead?
Code:
clip = core.ffms2.Source(src)
cleansed = core.rgvs.Clense(clip)
sbegin = core.rgvs.ForwardClense(clip)
send = core.rgvs.BackwardClense(clip)
scenechange = core.vsrd.SCSelect(clip, sbegin, send, cleansed)
alt = core.rgvs.Repair(scenechange, clip, mode=[16,16,1])
restore = core.rgvs.Repair(cleansed, clip, mode=[16,16,1])
corrected = core.vsrd.RestoreMotionBlocks(cleansed, restore, neighbour=clip, alternative=alt, gmthreshold=70, dist=1, dmode=2, noise=10, noisy=12, grey=0)
clip = core.rgvs.RemoveGrain(corrected, mode=[17,17,1])
clip.set_output()
Lastly, in my humble opinion I think RemoveDirt's namespace "vsrd" should be changed to "rdvs", making it familiar with RemoveGrain's "rgvs" namespace.

---

I wonder why Kassandro chose clense instead of cleanse?
Reel.Deel is offline   Reply With Quote
Old 16th November 2013, 02:22   #1097  |  Link
handaimaoh
Guest
 
Posts: n/a
Yes, the calls should have been changed. My bad missing that. I'll look to see why it doesn't load. Last time I tested it it did.
  Reply With Quote
Old 16th November 2013, 09:38   #1098  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Quote:
Originally Posted by Myrsloik View Post
506k frames later and it still works. I don't think this method of testing will yield anything. I'll add logging of fatal errors and then let you try that build.
Sounds good. Thank you.
Update: got it crash faster while testing with vspipe. I think it said "fwrite error". Testing again with redirecting stderr to file.
__________________
...desu!

Last edited by Mystery Keeper; 16th November 2013 at 10:11.
Mystery Keeper is offline   Reply With Quote
Old 16th November 2013, 10:29   #1099  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Ok, it has crashed with "fwrite() call failed" error while ran in windows console with output to stdout.
vspipe D:\Programming\TempLinearApproximate-VapourSynth\build\release-x32\test.vpy - -progress 2>E:\vsout.txt
Here's the log.
It has not crashed for 1500 frames with stdout redirected to file (which wasn't intentional) before I've stopped it.
Used this script to give it harder time.

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(2500)

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=5, 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 = 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 16th November 2013, 10:39   #1100  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Actually, it might have been an unprintable character issue. Trying again with redirecting stdout to nul.
__________________
...desu!
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 13:22.


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