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 September 2015, 20:11   #1681  |  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
How do one use a similar function to avisynths import() ?

I tried the "python way": exec(open('filter.vpy').read()) but that just resulted in a error message: Unhandled C++ Exception...

Edit: Nevermind, I forgot to remove the source filter from the filter.vpy template, now it works...
How did you get the unhandled C++ exception? If you can describe it and provide the exact scripts you used it'd help a lot. It should never crash because of python exec...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 11th September 2015, 20:18   #1682  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Quote:
Originally Posted by Myrsloik View Post
How did you get the unhandled C++ exception? If you can describe it and provide the exact scripts you used it'd help a lot. It should never crash because of python exec...
Here here was my ep01.vpy
PHP Code:
import vapoursynth as vs
core 
vs.get_core(threads=8)
vid core.avisource.AVIFileSource('I:/ep01.avs')
exec(open('filter.vpy').read()) 
and here was my filter.vpy when it crashed:
PHP Code:
import vapoursynth as vs
core 
vs.get_core(threads=8)
vid core.avisource.AVIFileSource('I:/filter.avs')
vid core.resize.Spline(clip=vidwidth=960height=540)
super core.mv.Super(vid)
mvbw3 core.mv.Analyse(superisb=Truedelta=3overlap=4,blksize=8)
mvbw2 core.mv.Analyse(superisb=Truedelta=2overlap=4,blksize=8)
mvbw core.mv.Analyse(superisb=Truedelta=1overlap=4,blksize=8)
mvfw core.mv.Analyse(superisb=Falsedelta=1overlap=4,blksize=8)
mvfw2 core.mv.Analyse(superisb=Falsedelta=2overlap=4,blksize=8)
mvfw3 core.mv.Analyse(superisb=Falsedelta=3overlap=4,blksize=8)
out core.mv.Degrain3(clip=vidsuper=supermvbw=mvbwmvfw=mvfwmvbw2=mvbw2mvfw2=mvfw2mvbw3=mvbw3mvfw3=mvfw3thsad=275)
#out = core.hist.Luma(clip=out)
out.set_output() 
ep01.avs is:
PHP Code:
DGsource("ep01.dgi"
As you can see, I forgot to comment some stuff out in filter.vpy when it crashed, also filter.avs did not exist since I renamed that to ep01.avs
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 13th September 2015, 09:56   #1683  |  Link
cybersharky
Registered User
 
Join Date: Jul 2008
Posts: 131
What python path's are needed to install vapoursynth? What registry locations does the installer check?

On attempting to install I get:


my user and system paths start with:
Code:
C:\Python34\;C:\Python34\Scripts;
but they do also have:
Code:
C:\Enthought\Canopy32\User;C:\Enthought\Canopy32\User\Scripts;
I need Canopy's python 2 version for courses I'm doing.

Yes, I have installed python 3.4.3 for all users.

I'm on Windows 8.1 x64, all the latest updates installed.
cybersharky is offline   Reply With Quote
Old 13th September 2015, 11:13   #1684  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
We can't see your image because it looks like it's not public.
Are_ is offline   Reply With Quote
Old 13th September 2015, 11:25   #1685  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by cybersharky View Post
What python path's are needed to install vapoursynth? What registry locations does the installer check?

On attempting to install I get:


my user and system paths start with:
Code:
C:\Python34\;C:\Python34\Scripts;
but they do also have:
Code:
C:\Enthought\Canopy32\User;C:\Enthought\Canopy32\User\Scripts;
I need Canopy's python 2 version for courses I'm doing.

Yes, I have installed python 3.4.3 for all users.

I'm on Windows 8.1 x64, all the latest updates installed.
It check for HKCU/HKLM(32/64) SOFTWARE\Python\PythonCore\3.4\InstallPath. The standard keys written by the python installer.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 13th September 2015, 12:39   #1686  |  Link
cybersharky
Registered User
 
Join Date: Jul 2008
Posts: 131
Quote:
Originally Posted by Myrsloik View Post
It check for HKCU/HKLM(32/64) SOFTWARE\Python\PythonCore\3.4\InstallPath. The standard keys written by the python installer.
Thanks deleted the 64 bit references and was able to install vapoursynth
cybersharky is offline   Reply With Quote
Old 14th September 2015, 07:40   #1687  |  Link
hajj_3
Registered User
 
Join Date: Mar 2004
Posts: 1,125
python 3.5.0 is out now.
hajj_3 is offline   Reply With Quote
Old 14th September 2015, 11:38   #1688  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
Quote:
Originally Posted by hajj_3 View Post
python 3.5.0 is out now.
Is it necessary to update from 3.4 to 3.5?
~ VEGETA ~ is offline   Reply With Quote
Old 14th September 2015, 16:56   #1689  |  Link
hajj_3
Registered User
 
Join Date: Mar 2004
Posts: 1,125
Quote:
Originally Posted by ~ VEGETA ~ View Post
Is it necessary to update from 3.4 to 3.5?
when the creator of vapoursynth releases a new version you will need to upgrade to v3.5.
hajj_3 is offline   Reply With Quote
Old 14th September 2015, 17:09   #1690  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Python 3.5 will be required for the next release (and the test versions before that from now on). If someone with VS2010 wants to step up and compile modules for older Pythons I won't object. The biggest reason I don't support multiple versions on windows is testing.

Theoretically 2.x could work too but once again, testing. And ancient compilers. From now on I will only use VS2015 (or later) to compile this project on windows.

So now we should all celebrate Python 3.5 and its switch to a modern compiler. I can finally remove that old crap from my computer.

Btw, you should all use VS2015 too, the community edition is free.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 14th September 2015, 17:35   #1691  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Myrsloik View Post
From now on I will only use VS2015 (or later) to compile this project on windows.
I assume that would fix the mysterious vs2015 plugin vspipe crash?
feisty2 is offline   Reply With Quote
Old 14th September 2015, 18:04   #1692  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by feisty2 View Post
I assume that would fix the mysterious vs2015 plugin vspipe crash?
It should already be fixed in R28 test 2 actually.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 14th September 2015, 18:48   #1693  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,731
In MVTools for Vapoursynth,
Code:
bv3 = core.mv.Analyse(clip=superanalyse, dct=dct, blksize=blksize, overlap=overlap,
search=search, searchparam=searchparam, pelsearch=pelsearch, isb=true, lambda=lda,
chroma=chromamotion, delta=3, truemotion=truemotion, lsad=lsad, global=true, pnew=pnew,
badsad=badsad, badrange=badrange)
causes a syntax error (SyntaxError: invalid syntax) pointing around "search". If I remove that, it points to the next item around the same position. Is there some weird overflow going on?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 14th September 2015, 19:45   #1694  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Boulder View Post
In MVTools for Vapoursynth,
Code:
bv3 = core.mv.Analyse(clip=superanalyse, dct=dct, blksize=blksize, overlap=overlap,
search=search, searchparam=searchparam, pelsearch=pelsearch, isb=true, lambda=lda,
chroma=chromamotion, delta=3, truemotion=truemotion, lsad=lsad, global=true, pnew=pnew,
badsad=badsad, badrange=badrange)
causes a syntax error (SyntaxError: invalid syntax) pointing around "search". If I remove that, it points to the next item around the same position. Is there some weird overflow going on?
I don't know about "search", but "lambda" and "global" are Python keywords. Prefix them with an underscore:
Code:
_lambda=lda, ... _global=True
Oh, and maybe it's pointing at "search" because it's on a new line. Maybe Python needs all of that on a single line.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 14th September 2015, 20:18   #1695  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
The auto indentation of my IDE indents it like this:
Code:
bv3 = core.mv.Analyse(clip=superanalyse, dct=dct, blksize=blksize, overlap=overlap, 
                      search=search, searchparam=searchparam, pelsearch=pelsearch, 
                      isb=true, _lambda=lda, chroma=chromamotion, delta=3, truemotion=truemotion, 
                      lsad=lsad, _global=true, pnew=pnew, badsad=badsad, badrange=badrange)
Remember indentation is part of the syntax in python.

Last edited by Are_; 14th September 2015 at 20:21.
Are_ is offline   Reply With Quote
Old 14th September 2015, 20:21   #1696  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,731
I put it on a new line due to readability here, in my script it's all on the same line. Using the underscore seems to help, thanks The error message really didn't help there..

You might want to update the docs on the MVTools page to reflect this one.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 15th September 2015, 08:56   #1697  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Since those arguments already break avisynth compatibility, by requiring an underscore, it'd be better to just rename them from the get-go. This is a pretty serious submarine problem that's just going to catch more people out over time.
foxyshadis is offline   Reply With Quote
Old 16th September 2015, 23:40   #1698  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Here's R28 test3. It's mostly for the brave only.

Changes from test2 is that it needs a python 3.5 installation made for all users (next test will also support per user installations).

The new compile of assvapour is completely untested so report your findings there if you dare. It no longer uses fontconfig so if it works it should start up much quicker.

The expr filter has also been greatly sped up and now uses runtime code generation. Log, exp and pow currently aren't implemented though and will probably crash it if you try to use them. Everything else should work as expected.

Report your findings there as well.

Speed comparisons with R28 test2 (or R27) welcome.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 17th September 2015, 17:15   #1699  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,731
I just ran into a deadlock situation with R27, trying to use contrasharpening with 16-bit input.

Code:
import vapoursynth as vs
import scoll

core = vs.get_core()
cs = scoll.SColl()

clp = core.ffms2.Source(source='c:/x265/hotfuzz.vc1')

clp = core.fmtc.bitdepth(clp, bits=16)
clp = cs.contrasharpening(clp,clp)

clp.set_output()
SColl is from here: https://github.com/4re/vapoursynth-m...aster/scoll.py

When using vspipe to display clip info, it utilizes one CPU thread at 100% and the Task Manager shows that memory usage just keeps on increasing (it went over 2GB before I interrupted the execution). If I remove the conversion to 16-bit video, there's no problem.

Don't worry about the silly contrasharpening line, it's just to reproduce the problem.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th September 2015, 19:00   #1700  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Boulder View Post
I just ran into a deadlock situation with R27, trying to use contrasharpening with 16-bit input.

Code:
import vapoursynth as vs
import scoll

core = vs.get_core()
cs = scoll.SColl()

clp = core.ffms2.Source(source='c:/x265/hotfuzz.vc1')

clp = core.fmtc.bitdepth(clp, bits=16)
clp = cs.contrasharpening(clp,clp)

clp.set_output()
SColl is from here: https://github.com/4re/vapoursynth-m...aster/scoll.py

When using vspipe to display clip info, it utilizes one CPU thread at 100% and the Task Manager shows that memory usage just keeps on increasing (it went over 2GB before I interrupted the execution). If I remove the conversion to 16-bit video, there's no problem.

Don't worry about the silly contrasharpening line, it's just to reproduce the problem.
It uses std.Lut2 inside. With two 16 bit clips, that means there will be a table of 65536 * 65536 elements, which is over 4 billion. With 2 bytes per element, that requires 8 GiB of RAM and probably takes a while to initialise.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill 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 11:28.


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