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

TurboPascal7
13th September 2012, 02:37
c = vs.Core(accept_lowercase=True)
c.std.loadplugin(path=r'C:\Buf\vapoursynth\ffms2.dll')
ret = c.ffms2.source(source=r"C:\Buf\vapoursynth\sample.mkv")
print(ret.format)
Output with r7:
Traceback (most recent call last):
File "C:/Buf/vapoursynth/test.py", line 7, in <module>
print(ret.format)
File "vapoursynth.pyx", line 202, in vapoursynth.Format.__str__ (cython\vapoursynth.c:3291)
AttributeError: 'str' object has no attribute 'decode'
Works right with r6.

Also, vapoursynth r7 prints the name of every positional argument used to stdout. Looks like someone forgot to remove debug code or something. >__>

Caroliano
13th September 2012, 03:13
The most restrictive free software license you can chose is likely is the GNU Affero GPL, and may be a good choice because there is lots of transcoding going on in the ~cloud~. x264 devs apparently managed to get corporate sponsors with GPL, and LuaJIT with the liberal MIT license.

Anyway, the only thing you should not do (besides not releasing the source code ;) ) is create your own open source license. Repositories like Sourceforge and Google Code refuse to host software that are not under a OSI accepted license, exactly to tack on the license proliferation problem.

Myrsloik
13th September 2012, 07:48
Also, vapoursynth r7 prints the name of every positional argument used to stdout. Looks like someone forgot to remove debug code or something. >__>

I'v reuploaded R7 with the debug print and .decode stuff fixed.

Reel.Deel
13th September 2012, 15:03
Hi Myrsloik, I was wondering if core.list_functions() is the only way to display internal functions.
The reason I ask is because I see people using print(clip.format,clip.width,clip.height) and that does not show up in the core.list_functions().

JEEB
13th September 2012, 15:07
Hi Myrsloik, I was wondering if core.list_functions() is the only way to display internal functions.
The reason I ask is because I see people using print(clip.format,clip.width,clip.height) and that does not show up in the core.list_functions().
Print (http://docs.python.org/py3k/library/functions.html?highlight=print#print) is a standard Python function. Now we have the power of a whole scripting language as well at our hands :)

Reel.Deel
13th September 2012, 15:11
Ahhh, I see. I guess after work I will be doing some reading. Thanks JEEB. :)

gyth
13th September 2012, 15:37
(unfortunately python itself has one huge mutex called the GIL so if it’s used too much it could lead to serious slowdowns)
The GIL is part of the threading module.
There is also a multiprocess (http://docs.python.org/library/multiprocessing.html#module-multiprocessing) module.

I haven't used either so it might be a non solution as well.

Chikuzen
14th September 2012, 06:56
If I type 'print(clip.format)' to Python shell, it will be displayed as follows.

Id: 3000024
Name: YUV444P16
Color Family: YUV

But, 'print(help(vs))' says as follows.

Yuv = 3000000
Yuv410P8 = 3000013
Yuv411P8 = 3000014
Yuv420P10 = 3000019
Yuv420P16 = 3000022
Yuv420P8 = 3000010
Yuv420P9 = 3000016
...

This is troublesome.
According to PEP8 (http://www.python.org/dev/peps/pep-0008/#constants), you should unify all the constant names with the capital letter.

Myrsloik
14th September 2012, 07:15
If I type 'print(clip.format)' to Python shell, it will be displayed as follows.


But, 'print(help(vs))' says as follows.

This is troublesome.
According to PEP8 (http://www.python.org/dev/peps/pep-0008/#constants), you should unify all the constant names with the capital letter.

Will change it in the next version.

TheProfileth
15th September 2012, 01:30
The GIL is part of the threading module.
There is also a multiprocess (http://docs.python.org/library/multiprocessing.html#module-multiprocessing) module.

I haven't used either so it might be a non solution as well.

Hmm after a cursory glance over some of the stuff in there it is pretty interesting. I wonder if Myrsloik had already considered that method?
In an only semi-related question, it has been established that some form of multithreading will be used, but is the multithreading going to be only in the vapoursynth core or independently implemented into individual filters or both or what?
Sorry if this has been covered already just have been under the assumption that vapoursynth itself is multithreaded but individual filters will need to be programmed to support multithreading and I wanted to be clear if this has already been discussed.

Myrsloik
15th September 2012, 01:56
Maybe a threading explanation would be in place. First consider avisynth. With its model every filter needs to implement multithreading itself. And to ever get close to 90% cpu usage every filter has to do it really well. Splitting the workload of a single frame evenly for every core.

This has a couple of problems. One is that few people bother to do it. Another is that even fewer have a good understanding of thread synchronization. It can also be fairly error prone and writing portable code that uses threads also requires some extra library for abstraction.

Instead it becomes much simpler when the threading is handled by the core. For example writing a filter that can process several frames at once only needs one extra rule compared to a serial one in avisynth. Don't modify the shared instance data. That's it. Even the slowest filters can usually be modified with not too much effort to match this. The core can now just assign one frame to each thread for processing.

There should be no real reason for filter writers to handle threading themselves. Actually it would most likely trip up the threading handled by the vapoursynth core.

So to sum it up. Vapoursynth filters as such have to know nothing of threading. They just have to follow a few simple rules that makes it possible to run them in a threaded environment.

I hope this makes sense. I'm so sleepy

TheProfileth
15th September 2012, 04:05
Thanks for the clarification Myrsloik, that makes a lot more sense

Rumbah
15th September 2012, 11:35
Will there be some kind of threading pool for temporal filters?

Myrsloik
15th September 2012, 11:40
Will there be some kind of threading pool for temporal filters?

It's already implemented. See how fast mvtools is now. To the core there's no real difference between spatial and temporal filters.

Chikuzen
15th September 2012, 11:53
after some consideration, I decided to write a small plugin for VapourSynth.

coding was finished in half a day. LINK (https://github.com/chikuzen/VS_AvsReader)
Since some changes will be further made before a formal release as for VapourSynth and the license of VS is not clear, i will not distribute binary at soon:p

Myrsloik
15th September 2012, 11:58
after some consideration, I decided to write a small plugin for VapourSynth.

coding was finished in half a day. LINK (https://github.com/chikuzen/VS_AvsReader)
Since some changes will be further made before a formal release as for VapourSynth and the license of VS is not clear, i will not distribute binary at soon:p

That could definitely be useful. Now all we need is a VSReader for avisynth and then the insane filtering can begin for real :sly:

tebasuna51
16th September 2012, 01:11
...
src = ret
c = core.avs.MSuper(c1=src)
b1v = core.avs.MAnalyse(c1=c, delta=1, isb=False)
f1v = core.avs.MAnalyse(c1=c, delta=1, isb=True)
b2v = core.avs.MAnalyse(c1=c, delta=2, isb=False)
f2v = core.avs.MAnalyse(c1=c, delta=2, isb=True)
ret = core.avs.MDegrain2(c1=src, c2=c, c3=b1v, c4=f1v, c5=b2v, c6=f2v)
ret.output(sys.stdout, y4m=True)

Is correct your script?

In MAnalyse docs:
isb : allows to choose between a forward search (motion from the previous frame to current one) for isb=false and a backward search (motion from following frame to the current one) for isb=true (isb stands for "IS Backward", it is implemented and named exactly as written here, do not ask :-). Default isb=false.

The name don't match, but c3 in MDegrain2 must be the backward or the forward?

Myrsloik
16th September 2012, 01:21
Is correct your script?

In MAnalyse docs:


The name don't match, but c3 in MDegrain2 must be the backward or the forward?

Congratulations! you're the first once to spot that error!

On a side note, I've decided to use the affero GPL and I'm about halfway to having R8 ready.

TheProfileth
16th September 2012, 02:30
Congratulations! you're the first once to spot that error!

On a side note, I've decided to use the affero GPL and I'm about halfway to having R8 ready.

Congrats on your decision :)
Also so I assume with your clarification of the multithreading that you are not considering implementing the multiprocessing module.

Guest
16th September 2012, 03:00
On a side note, I've decided to use the affero GPL. Will Affero GPL allow dynamic invocation of Vapoursynth without "infecting" the application, i.e., is it like LGPL? If it is not like LGPL, I submit that it may be an unwise decision to use this license.

Assuming that you will allow some kind of LGPL-like licensing, consider this:

In order not to inhibit plugin writers who wished to keep their plugin source private, and other apps that wanted to use Avisynth without disclosing their source, Ben Rudiak-Gould exempted avisynth.h from LGPL and made it freely usable. Will you consider doing the same for your equivalent interface? Thank you.

Myrsloik
16th September 2012, 03:12
Will Affero GPL allow dynamic invocation of Vapoursynth without "infecting" the application, i.e., is it like LGPL? If it is not like LGPL, I submit that it may be an unwise decision to use this license.

Assuming that you will allow some kind of LGPL-like licensing, consider this:

In order not to inhibit plugin writers who wished to keep their plugin source private, and other apps that wanted to use Avisynth without disclosing their source, Ben Rudiak-Gould exempted avisynth.h from LGPL and made it freely usable. Will you consider doing the same for your equivalent interface? Thank you.

Of course I'll have an exception similar to avisynth.

Daemon404
16th September 2012, 03:13
Will Affero GPL allow dynamic invocation of Vapoursynth without "infecting" the application, i.e., is it like LGPL? If it is not like LGPL, I submit that it may be an unwise decision to use this license.

Assuming that you will allow some kind of LGPL-like licensing, consider this:

In order not to inhibit plugin writers who wished to keep their plugin source private, and other apps that wanted to use Avisynth without disclosing their source, Ben Rudiak-Gould exempted avisynth.h from LGPL and made it freely usable. Will you consider doing the same for your equivalent interface? Thank you.

Ahem.

http://forum.doom9.org/showpost.php?p=1591132&postcount=150
http://www.vapoursynth.com/2012/09/r7-the-source-is-slowly-coming/

http://i.imgur.com/63mme.png

Guest
16th September 2012, 03:18
Well, Daemon404, that's very cute but you missed my point, which I tried to make diplomatically.

Actually, Affero is GPL-like and so is unsuitable for Vapoursynth. I'm interested in the author's opinion on that.

Daemon404
16th September 2012, 03:26
Well, Daemon404, that's very cute but you missed my point, which I tried to make diplomatically.

Actually, Affero is GPL-like and so is unsuitable for Vapoursynth. I'm interested in the author's opinion on that.

The two thinks I lined were actually relevant. They make is stance on plugins pretty clear. Also he replied above.

Guest
16th September 2012, 03:35
The main point has not been addressed. A GPL-like license does not appear suitable. Please do me a favor and let Myrsloik answer about that if he cares too. Thanks!

Gavino
16th September 2012, 09:22
Is correct your script?

The name don't match, but c3 in MDegrain2 must be the backward or the forward?
Actually, although the script is technically incorrect, it doesn't matter here because MDegrain works symmetrically, using both backward and forward vectors in the same way.

Myrsloik
16th September 2012, 11:20
The main point has not been addressed. A GPL-like license does not appear suitable. Please do me a favor and let Myrsloik answer about that if he cares too. Thanks!

How would it be unsuitable? Avisynth has been doing fine for a long time with gpl+linking exception. I don't see what new problems having licensing pretty much identical to avisynth would cause. Or is there a huge problem with the avisynth licensing too that I've missed?

vcmohan
16th September 2012, 12:35
When you have the Python installed why Visual C++ 2008 and 2010 are required? Are these two only for plugin coders only or ordinary users also are required to install these two?

active1
16th September 2012, 12:35
after some consideration, I decided to write a small plugin for VapourSynth.

coding was finished in half a day. LINK (https://github.com/chikuzen/VS_AvsReader)
Since some changes will be further made before a formal release as for VapourSynth and the license of VS is not clear, i will not distribute binary at soon:p

how to use it?

Myrsloik
16th September 2012, 12:44
When you have the Python installed why Visual C++ 2008 and 2010 are required? Are these two only for plugin coders only or ordinary users also are required to install these two?

Python needs the vs2008 runtime and vapoursynth needs the 2010 one. I don't see what else there is to say. I do however think python 3.2 installs the 2008 one and I suspect the soon to be released python 3.3 will use the 2010 runtime.

I don't see the problem with this unless there's a misunderstanding somewhere.

hajj_3
16th September 2012, 13:03
python 3.3 does indeed use VS2010.

Chikuzen
16th September 2012, 13:17
how to use it?

I added readme to git repo previously.
see it.

Guest
16th September 2012, 13:42
How would it be unsuitable? Avisynth has been doing fine for a long time with gpl+linking exception. I don't see what new problems having licensing pretty much identical to avisynth would cause. Or is there a huge problem with the avisynth licensing too that I've missed? That would be fine! But originally you only mentioned Afero GPL. Avisynth ships with a GPL license for use of its code and an LGPL license for linking. But I am not aware of any Afero LGPL like license. So I was asking how you intended to manage the linking part. Not trying to make any trouble, just trying to help ensure maximum success!

malmsteen81
17th September 2012, 09:35
but it can work for real-time play like ffdhow + avisynth?

Myrsloik
18th September 2012, 00:56
but it can work for real-time play like ffdhow + avisynth?

Same method, same hack.

Anyway, the next version is almost ready. I'm surprised none of you pointed out the huge memory leak in crop.

malmsteen81
18th September 2012, 08:54
Same method, same hack.



what do you mean?

active1
18th September 2012, 10:35
how will the vfwvs work on linux? is it for windows only?

Myrsloik
18th September 2012, 10:43
how will the vfwvs work on linux? is it for windows only?

Hint (http://en.wikipedia.org/wiki/Video_for_Windows)

Chikuzen
18th September 2012, 13:53
>>> print(clip.format)
Format Descriptor
Id: 1000010
Name: Gray8
Color Family: Gray
Sample Type: Integral
Bits Per Sample: 8
Bytes Per Sample: 1
Planes: 1
Subsampling W: 0
Subsampling H: 0

>>> file=open('gray.yuv', 'wb')
>>> clip.output(file, y4m=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "vapoursynth.pyx", line 294, in vapoursynth.VideoNode.output (cython\vapoursynth.c:5193)
vapoursynth.Error: 'Cannot apply y4m headers to non-yuv/unknown formats'

>>> clip.output(file, y4m=False)
>>> file.close()
>>>

https://dl.dropbox.com/u/19797864/y4mheader_exists.png

is this bug already fixed?

Myrsloik
18th September 2012, 14:08
>>> print(clip.format)
Format Descriptor
Id: 1000010
Name: Gray8
Color Family: Gray
Sample Type: Integral
Bits Per Sample: 8
Bytes Per Sample: 1
Planes: 1
Subsampling W: 0
Subsampling H: 0

>>> file=open('gray.yuv', 'wb')
>>> clip.output(file, y4m=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "vapoursynth.pyx", line 294, in vapoursynth.VideoNode.output (cython\vapoursynth.c:5193)
vapoursynth.Error: 'Cannot apply y4m headers to non-yuv/unknown formats'

>>> clip.output(file, y4m=False)
>>> file.close()
>>>

https://dl.dropbox.com/u/19797864/y4mheader_exists.png

is this bug already fixed?

Will fix. Forgot that gray is also a kind of yuv

Myrsloik
20th September 2012, 20:02
R8 released. The post on the front page of the website explains how the new function type can be used.

kolak
20th September 2012, 20:53
When vfw module get released how we will be able to use it?

Myrsloik
20th September 2012, 20:58
When vfw module get released how we will be able to use it?

By following the instructions.

kolak
20th September 2012, 21:36
Hehehe- but what will it give to me?
Will it be a filter which will show up eg, in Vdub?
Will it work as a source filter/decoder with additional processing possibilities?

Chikuzen
20th September 2012, 21:54
@Myrsloik
Currently, VS has no methods to convert YUV to RGB.
output/get_frame from COMPATBGR32 cause clash(since it seems that you don't like packed format, I suspect whether this is intentional), and swscale can't convert to GBRP.

I would like to know whether you have a schedule to implement it.

JEEB
20th September 2012, 22:13
Hehehe- but what will it give to me?
Will it be a filter which will show up eg, in Vdub?
Will it work as a source filter/decoder with additional processing possibilities?
It's like reading a fake AVI, LikeItSaysOnTheTin.

Myrsloik
20th September 2012, 23:05
@Myrsloik
Currently, VS has no methods to convert YUV to RGB.
output/get_frame from COMPATBGR32 cause clash(since it seems that you don't like packed format, I suspect whether this is intentional), and swscale can't convert to GBRP.

I would like to know whether you have a schedule to implement it.

Yes, I intend to keep the core simple. Packed formats are only allowed for special plugins (avisynth compat+the other internal filters where it makes sense). Everything else will be planar. Always. I've asked the libav people about when planar RGB will be implemented. If it's not really soon I'll just write a patch for it myself.

I also found a bug in the resizer and the error handling and fixed it so now at least YUY2<->planar formats should work. And you'll get a nice error message for conversions to RGB24.
Redownload R8 to get the fixes.

Chikuzen
20th September 2012, 23:51
Redownload R8 to get the fixes.

now, I can preview a frame via PIL. :thanks:

kolak
21st September 2012, 00:13
It's like reading a fake AVI, LikeItSaysOnTheTin.

Well if it's possible to present whole script, with source filter and all processing to external programmes as fake AVI (like current avfs mounting), but with more possible output formats, including v210 etc I will be over the moon- hehe :)

Are_
25th September 2012, 11:20
Transpose crashes python.exe
vs-v8(redownload)
python-3.2.3