Log in

View Full Version : Vapoursynth


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 [34] 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

~ VEGETA ~
22nd August 2015, 03:50
I'd like to run some speed comarisions with AVS, can you tell me the best method (fair)? I am using x264 right now but for avs it is just ffvideosource and feed the script directly into x264. However, for VS there is the vspipe stuff which is an extra... So the comparision is not fair I think.

~ VEGETA ~
22nd August 2015, 12:34
I have used x264-32bit-8bit-tmod to do some comparison...

Settings:
10-bit SD source (24 min)
x264 with no options [Defaults]
script: ffms2 source + f3kdb

Result:

vs : fps=81.42 - duration=0:06:06
avs: fps=78.19 - duration=0:06:21

x264 tried vsimport but failed, it tried avisource and succeeded. I wonder why?

Is there any faults in this method of comparison? I ask because I got different file size in both methods.

tona69
22nd August 2015, 23:15
Hi, in Vapoursynth R27-R28 when I want to use subtitles, mark this error

Fontconfig error: Cannot load default config file

import vapoursynth as vs
core = vs.get_core( )

outClip = core.std.BlankClip( width=1280, height=720, format=vs.YUV420P8, length=10, fpsnum=24000, fpsden=1001, color=[255, 127, 127] )

subs = core.assvapour.AssRender( outClip, file="video.ass" )

subs[0] = core.resize.Bicubic( subs[0], format=vs.YUV420P8 )
outClip = core.std.MaskedMerge(outClip, subs[0], subs[1])

outClip.set_output( )

video.ass
[Script Info]
; Script generated by Aegisub 3.2.0
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
PlayResX: 1280
PlayResY: 720

[Aegisub Project Garbage]
Last Style Storage: Default
Video File: ?dummy:23.976000:40000:1280:720:215:215:215:c
Video AR Value: 1.777778
Video Zoom Percent: 0.531944
Active Line: 2

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,50,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,4,0,5,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:00.39,Default,,0,0,0,,{\move(235,70,135,640,0,375)}move1
Dialogue: 0,0:00:00.00,0:00:00.39,Default,,0,0,0,,{\t(\fscx75\fscy75\bord3)\move(630,70,530,640,0,375)}move2
Dialogue: 0,0:00:00.00,0:00:00.39,Default,,0,0,0,,{\org(235,70)\pos(1125,70)\t(\frz-40\fscx125\fscy125\bord5)}move3
vspipe -y video.vpy - | x264 --crf 18 --output video.mp4 --demuxer y4m -

jackoneill
23rd August 2015, 05:58
Hi, in Vapoursynth R27-R28 when I want to use subtitles, mark this error



Is it fatal?

stax76
29th August 2015, 18:35
Hello Myrsloik,

Windows-1252 covered characters ä, ü and ö in source filenames cause an exception.

https://en.wikipedia.org/wiki/Windows-1252

Python exception: 'utf-8' codec can't decode byte 0xe4 in position 192: invalid continuation byte
Traceback (most recent call last):
File "vapoursynth.pyx", line 1466, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:24692)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 192: invalid continuation byte

clip = core.ffms2.Source(source = r'D:\Temp\Encoding\häh.mp4', cachefile = r'D:\Temp\Encoding\häh temp files\häh.ffindex')

sneaker_ger
29th August 2015, 18:37
Save your script as UTF-8?

stax76
29th August 2015, 20:22
Save your script as UTF-8?

produces a different error:

Python exception: invalid character in identifier (häh_Source.vpy, line 1)
Traceback (most recent call last):
File "vapoursynth.pyx", line 1466, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:24705)
File "D:\Temp\Encoding\häh temp files\häh_Source.vpy", line 1
import vapoursynth as vs
^
SyntaxError: invalid character in identifier

clip = core.ffms2.Source(source = r'D:\Temp\Encoding\häh.mp4', cachefile = r'D:\Temp\Encoding\häh temp files\häh.ffindex')

sneaker_ger
29th August 2015, 20:28
Save as UTF-8 without BOM.

foxyshadis
29th August 2015, 22:20
That's odd, python can read source files with a BOM just fine, so the same script will work on the command-line. VS should probably trap this exception in vpy_evaluateScript and retry with script.decode('utf-8-sig'). (And perhaps the user's default locale, but discouraging the use of code pages as much as possible in every form is probably wise.)

Myrsloik
29th August 2015, 22:28
That's odd, python can read source files with a BOM just fine, so the same script will work on the command-line. VS should probably trap this exception in vpy_evaluateScript and retry with script.decode('utf-8-sig'). (And perhaps the user's default locale, but discouraging the use of code pages as much as possible in every form is probably wise.)

Judging by the description only using utf-8-sig should always do the right thing. Correct me of I'm wrong.

stax76
29th August 2015, 22:30
Save as UTF-8 without BOM.

works! :)

foxyshadis
29th August 2015, 23:04
Judging by the description only using utf-8-sig should always do the right thing. Correct me of I'm wrong.

Looks like it. Double-checked the source and it does handle it either way.

Kupildivan
30th August 2015, 12:04
Is there compiled FFT3DFilter.dll for VS?

feisty2
30th August 2015, 12:06
fft3d is old and obsolete cuz dfttest kicks its ass.

Kupildivan
30th August 2015, 12:13
Forgot to mention, dfttest is too slow for me. That's why I ask.

feisty2
30th August 2015, 12:21
then, no.
no one seems to, well, want to port fft3d...
but, you can pick smaller sb/so/tb/tosize values and speed dfttest up.

Kupildivan
30th August 2015, 12:33
OK then. Thanks for info.

Reel.Deel
30th August 2015, 13:23
no one seems to, well, want to port fft3d...


VFR-maniac ported FFT3DFilter (https://github.com/VFR-maniac/VapourSynth-FFT3DFilter) (along with a few other plugins (https://github.com/VFR-maniac?tab=repositories)) but as usual he did not release any binaries.

feisty2
30th August 2015, 13:37
VFR-maniac ported FFT3DFilter (https://github.com/VFR-maniac/VapourSynth-FFT3DFilter) (along with a few other plugins (https://github.com/VFR-maniac?tab=repositories)) but as usual he did not release any binaries.

http://i.imgur.com/D6id5Us.png
got not much luck with it :)

Are_
30th August 2015, 14:45
It compiles just fine with gcc.

feisty2
30th August 2015, 14:49
It compiles just fine with gcc.

then you should probably post the binaries and do Kupildivan a favor :)
I'm just too newbie to be a gcc guy

Are_
30th August 2015, 20:18
Also I think Linux binaries will not be much useful to him. :/

Myrsloik
4th September 2015, 12:10
Don't forget to install all updates. Here's a friendly reminder. (http://www.vapoursynth.com/2015/09/windows-update-use-it/)

Myrsloik
5th September 2015, 17:25
Now for a small poll. Should the next version be compiled for python 3.4 or 3.5?

This of course assumes python 3.5 will be released by then. It's probably less than a week away.

stax76
5th September 2015, 18:23
I would prefer 3.5.

Khanattila
6th September 2015, 00:21
Unfortunately VS-FFT3DFilter's processing is single-threaded, which make it not significantly faster than DFTTest. More importantly, it supports only 8-bit input and will introduce banding after denoising. I'd recommend KNLMeans as one of the other choices if he has a decent GPU.
Without offending anyone, I'd recommend always KNLMeans :rolleyes:

Sparktank
6th September 2015, 00:39
python 3.4 or 3.5?

I remember some time before when I first tried to install, VS was done using older python and I had already installed newest updates for python. I had decided to wait for VS to update to newest python, but by then a lot of time had passed and I forgot.

So, I would vote for the newest python, 3.5.
Anyone new looking into VS will be off to a very fresh start, as fresh as possible, at least.

feisty2
6th September 2015, 07:45
3.5, always not a bad thing tryna stay update

Myrsloik
8th September 2015, 22:00
Here's R28 test 2 (https://dl.dropboxusercontent.com/u/73468194/vapoursynth-r28-test2.exe).

WARNING! The VS2015 runtime needs to be installed manually for now

Note that this build was made with VS2015 and without tcmalloc. Speed comparisons to R27 would be interesting to see. Apart from the compiler switch it's more or less purely a bugfix release.

r28:
get_core() can now be used in callbacks and other external functions in python
now returns an error message saying that windows needs to be updated in certain cases when plugin loading fails
fixed loop filter (nodame)
lut and lut2 can now output float as well
now accepts scripts that start with a BOM as well
fixed an image corruption bug with 9-16 bit input to rgvs when the c++ code is used
fixed division by zero issues in muldivrational in vshelper.h
blankclip can now create 0 (unknown/variable) fps clips
added float support to planedifference and planeaverage
added half support to addborders
relevant compile time options are now in the version string

Still uses python 3.4 obviously.

mastrboy
11th September 2015, 19:50
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...

Myrsloik
11th September 2015, 20:11
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...

mastrboy
11th September 2015, 20:18
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
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:
import vapoursynth as vs
core = vs.get_core(threads=8)
vid = core.avisource.AVIFileSource('I:/filter.avs')
vid = core.resize.Spline(clip=vid, width=960, height=540)
super = core.mv.Super(vid)
mvbw3 = core.mv.Analyse(super, isb=True, delta=3, overlap=4,blksize=8)
mvbw2 = core.mv.Analyse(super, isb=True, delta=2, overlap=4,blksize=8)
mvbw = core.mv.Analyse(super, isb=True, delta=1, overlap=4,blksize=8)
mvfw = core.mv.Analyse(super, isb=False, delta=1, overlap=4,blksize=8)
mvfw2 = core.mv.Analyse(super, isb=False, delta=2, overlap=4,blksize=8)
mvfw3 = core.mv.Analyse(super, isb=False, delta=3, overlap=4,blksize=8)
out = core.mv.Degrain3(clip=vid, super=super, mvbw=mvbw, mvfw=mvfw, mvbw2=mvbw2, mvfw2=mvfw2, mvbw3=mvbw3, mvfw3=mvfw3, thsad=275)
#out = core.hist.Luma(clip=out)
out.set_output()

ep01.avs is:
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

cybersharky
13th September 2015, 09:56
What python path's are needed to install vapoursynth? What registry locations does the installer check?

On attempting to install I get:
https://photos-4.dropbox.com/t/2/AACZw7bGXksnp_Ji-gOSp3oxxr_FosnShSSGLvOiWlcu6Q/12/47490038/png/32x32/1/_/1/2/Screenshot%202015-09-13%2010.44.52.png/EP7stSQYzh4gAigC/lgyts8TZNo7z2lRBYEcs2Ux4qn3xsUTJAIVBAPXKQLI?size=1280x960&size_mode=2

my user and system paths start with:
C:\Python34\;C:\Python34\Scripts;

but they do also have:
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.

Are_
13th September 2015, 11:13
We can't see your image because it looks like it's not public.

Myrsloik
13th September 2015, 11:25
What python path's are needed to install vapoursynth? What registry locations does the installer check?

On attempting to install I get:
https://photos-4.dropbox.com/t/2/AACZw7bGXksnp_Ji-gOSp3oxxr_FosnShSSGLvOiWlcu6Q/12/47490038/png/32x32/1/_/1/2/Screenshot%202015-09-13%2010.44.52.png/EP7stSQYzh4gAigC/lgyts8TZNo7z2lRBYEcs2Ux4qn3xsUTJAIVBAPXKQLI?size=1280x960&size_mode=2

my user and system paths start with:
C:\Python34\;C:\Python34\Scripts;

but they do also have:
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.

cybersharky
13th September 2015, 12:39
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 :)

hajj_3
14th September 2015, 07:40
python 3.5.0 is out now.

~ VEGETA ~
14th September 2015, 11:38
python 3.5.0 is out now.

Is it necessary to update from 3.4 to 3.5?

hajj_3
14th September 2015, 16:56
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.

Myrsloik
14th September 2015, 17:09
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.

feisty2
14th September 2015, 17:35
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?

Myrsloik
14th September 2015, 18:04
I assume that would fix the mysterious vs2015 plugin vspipe crash?

It should already be fixed in R28 test 2 actually.

Boulder
14th September 2015, 18:48
In MVTools for Vapoursynth,
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?

jackoneill
14th September 2015, 19:45
In MVTools for Vapoursynth,
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:

_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.

Are_
14th September 2015, 20:18
The auto indentation of my IDE indents it like this:

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.

Boulder
14th September 2015, 20:21
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.

foxyshadis
15th September 2015, 08:56
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.

Myrsloik
16th September 2015, 23:40
Here's R28 test3 (https://dl.dropboxusercontent.com/u/73468194/vapoursynth-r28-test3.exe). 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.

Boulder
17th September 2015, 17:15
I just ran into a deadlock situation with R27, trying to use contrasharpening with 16-bit input.

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-modules/blob/master/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.

jackoneill
17th September 2015, 19:00
I just ran into a deadlock situation with R27, trying to use contrasharpening with 16-bit input.

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-modules/blob/master/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.