VapourSource
From Avisynth wiki
(Difference between revisions)
(→Supported Formats) |
|||
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{FilterCat5|External_filters|Source_filters|Plugins|Plugins_x64|Deep_color_tools}} |
{{Filter3 | {{Filter3 | ||
− | | {{Author/Chikuzen}}, [https://github.com/DJATOM | + | | {{Author/Chikuzen}}, [https://github.com/DJATOM DJATOM] |
− | | 0. | + | | 0.2 |
− | | [ | + | | [https://github.com/DJATOM/VapourSource/releases Releases] |
| Source filters | | Source filters | ||
| [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | | [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | ||
Line 9: | Line 9: | ||
== Description == | == Description == | ||
− | <tt>VapourSource</tt> is a VapourSynth script reader for AviSynth 2.6. | + | <tt>VapourSource</tt> is a VapourSynth script reader for AviSynth+ / AviSynth 2.6. |
<br> | <br> | ||
== Requirements == | == Requirements == | ||
− | * [ | + | * [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6] |
− | * [http://www.vapoursynth.com/ VapourSynth] R32 or greater | + | * [x64]: [[AviSynth+]] |
+ | * [http://www.vapoursynth.com/ VapourSynth] R32 or greater (x86 or x64) | ||
* [[SSE2]] capable CPU | * [[SSE2]] capable CPU | ||
− | * [ | + | * [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2019 Redistributable Package] (x86 / x64) |
− | + | :<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>VapourSource-x86</tt> | |
+ | :<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>VapourSource-x64</tt> | ||
<br> | <br> | ||
+ | |||
== Supported Formats == | == Supported Formats == | ||
<tt>VapourSource</tt> supports the following formats: | <tt>VapourSource</tt> supports the following formats: | ||
Line 24: | Line 27: | ||
:{| class="wikitable" border="1"; width="400px" | :{| class="wikitable" border="1"; width="400px" | ||
|- | |- | ||
− | |||
!!width="200px"| [http://www.vapoursynth.com/doc/pythonreference.html#format-constants VapourSynth colorspace] | !!width="200px"| [http://www.vapoursynth.com/doc/pythonreference.html#format-constants VapourSynth colorspace] | ||
+ | !!width="200px"| AviSynth colorspace | ||
+ | !!width="200px"| [[Avisynthplus_color_formats#Color_Format_Table|AviSynth+ colorspace]] | ||
|- | |- | ||
− | |||
|RGB24 | |RGB24 | ||
+ | |[[RGB24]] | ||
+ | |[[RGB24]] | ||
|- | |- | ||
− | |||
|COMPATBGR32 | |COMPATBGR32 | ||
+ | |[[RGB32]] | ||
+ | |[[RGB32]] | ||
|- | |- | ||
− | |||
|COMPATYUY2 | |COMPATYUY2 | ||
+ | |[[YUY2]] | ||
+ | |[[YUY2]] | ||
|- | |- | ||
− | |[[Y8]] | + | |GRAY8 |
− | | | + | |[[Y8]] |
+ | |[[Y8]] | ||
|- | |- | ||
− | |[[ | + | |GRAY16/H |
− | | | + | |[[Y8]] (x2 width) |
+ | |[[Y16]] | ||
|- | |- | ||
− | |[[ | + | |GRAYS |
− | | | + | |[[Y8]] (x4 width) |
+ | |[[Y32]] | ||
|- | |- | ||
− | |[[ | + | |YUV420P8 |
− | | | + | |[[YV12]] |
+ | |[[YV12]] | ||
+ | |- | ||
+ | |YUV420P9/10/16 | ||
+ | |[[YV12]] (x2 width) | ||
+ | |[[YUV420P16]] | ||
+ | |- | ||
+ | |YUV422P8 | ||
+ | |[[YV16]] | ||
+ | |[[YV16]] | ||
+ | |- | ||
+ | |YUV422P9/10/16 | ||
+ | |[[YV16]] (x2 width) | ||
+ | |[[YUV422P16]] | ||
+ | |- | ||
+ | |YUV444P8 | ||
+ | |[[YV24]] | ||
+ | |[[YV24]] | ||
+ | |- | ||
+ | |YUV444P9/10/16 | ||
+ | |[[YV24]] (x2 width) | ||
+ | |[[YUV444P16]] | ||
+ | |- | ||
+ | |YUV444PS | ||
+ | |[[YV24]] (x4 width) | ||
+ | |[[YUV444PS]] | ||
|- | |- | ||
− | |||
|YUV411P8 | |YUV411P8 | ||
+ | |[[YV411]] | ||
+ | |[[YV411]] | ||
|- | |- | ||
− | | colspan=" | + | | colspan="3"| Only constant format/resolution/framerate clips are supported. |
|- | |- | ||
− | ! colspan=" | + | ! colspan="3"| *Y8/YV12/16/24 allow bit depths >8 using the 16bit interleaved format. |
|} | |} | ||
<br> | <br> | ||
+ | |||
== [[Script variables|Syntax and Parameters]] == | == [[Script variables|Syntax and Parameters]] == | ||
Line 64: | Line 101: | ||
<br> | <br> | ||
<br> | <br> | ||
− | :{{Template:FuncDef|VSImport (''string'' source, ''bool'' "stacked", ''int'' "index")}} | + | :{{Template:FuncDef|VSImport (''string'' source, ''bool'' "stacked", ''int'' "index", ''int'' "prefetch")}} |
<br> | <br> | ||
::{{Par2|source|string| }} | ::{{Par2|source|string| }} | ||
Line 74: | Line 111: | ||
::{{Par2|index|int|0}} | ::{{Par2|index|int|0}} | ||
:::Index of input clip. | :::Index of input clip. | ||
+ | <br> | ||
+ | ::{{Par2|prefetch|int|0}} | ||
+ | :::Request given amount of frames in advance (MT behaviour). If you have 4 physical cores, set it to 4. | ||
+ | :::If AviSynth part of script is too easy in comparison with VS one, It might be good idea to set prefetch to 5. Anyway you can tune it and seek for better performance. | ||
<br> | <br> | ||
------------------------------------ | ------------------------------------ | ||
Line 80: | Line 121: | ||
Evaluates a VapourSynth script inside an AviSynth script, no need for an external script. | Evaluates a VapourSynth script inside an AviSynth script, no need for an external script. | ||
<br> | <br> | ||
− | :{{Template:FuncDef|VSEval (''string'' source, ''bool'' "stacked", ''int'' "index")}} | + | :{{Template:FuncDef|VSEval (''string'' source, ''bool'' "stacked", ''int'' "index", ''bool'' "utf8", ''int'' "prefetch")}} |
<br> | <br> | ||
::{{Par2|source|string| }} | ::{{Par2|source|string| }} | ||
Line 90: | Line 131: | ||
::{{Par2|index|int|0}} | ::{{Par2|index|int|0}} | ||
:::Index of input clip. | :::Index of input clip. | ||
− | + | <br> | |
+ | ::{{Par2|utf8|bool|false}} | ||
+ | :::If this is set to true, source is assumed to be UTF-8 encoded (default: false). | ||
+ | <br> | ||
+ | ::{{Par2|prefetch|int|0}} | ||
+ | :::Request given amount of frames in advance (MT behaviour). If you have 4 physical cores, set it to 4. | ||
+ | :::If AviSynth part of script is too easy in comparison with VS one, It might be good idea to set prefetch to 5. Anyway you can tune it and seek for better performance. | ||
<br> | <br> | ||
== Examples == | == Examples == | ||
VSImport: | VSImport: | ||
− | VSImport("script.vpy", stacked=false, index=0) | + | VSImport("script.vpy", stacked=false, index=0, prefetch=4) |
<br> | <br> | ||
VSEval: | VSEval: | ||
Line 105: | Line 152: | ||
clip1.set_output(index=1) | clip1.set_output(index=1) | ||
""" | """ | ||
− | VSEval(source=script, index=1) | + | VSEval(source=script, index=1, prefetch=4) |
<br> | <br> | ||
== Changelog == | == Changelog == | ||
Version Date Changes<br> | Version Date Changes<br> | ||
− | 0.0. | + | 0.2 2020/04/06 - reworked prefetch code |
+ | - re-formatted source<br> | ||
+ | 0.1.1 2018/07/19 - add prefetch parameter for multithreading from VapourSynth.<br> | ||
+ | 0.1.0 2016/07/05 - support high bit depth formats of AviSynth+ | ||
+ | - requires Microsoft Visual C++ 2015 Redistributable Package<br> | ||
+ | 0.0.4 2016/05/07 - VS2010 to VS2015 | ||
- update avisynth.h, VapourSynth.h and VSScript.h | - update avisynth.h, VapourSynth.h and VSScript.h | ||
- add 64bit binary<br> | - add 64bit binary<br> | ||
− | 0.0.2 08/06 | + | 0.0.2 2013/08/06 - fix vertical flip issue on COMPATBGR32. |
- allow to input a RGB24 clip.<br> | - allow to input a RGB24 clip.<br> | ||
− | 0.0.1 07/31 | + | 0.0.1 2013/07/31 - initial release |
<br> | <br> | ||
+ | <!-- | ||
== Archived Downloads == | == Archived Downloads == | ||
{| class="wikitable" border="1"; width="800px" | {| class="wikitable" border="1"; width="800px" | ||
Line 131: | Line 184: | ||
|[http://www.mediafire.com/download/nrk3k4xakkwujqx/VapourSource-0.0.2.zip VapourSource-0.0.2.zip] -- [http://web.archive.org/web/20160302140330/https://codeload.github.com/chikuzen/VapourSource/zip/master VapourSource-master.zip] | |[http://www.mediafire.com/download/nrk3k4xakkwujqx/VapourSource-0.0.2.zip VapourSource-0.0.2.zip] -- [http://web.archive.org/web/20160302140330/https://codeload.github.com/chikuzen/VapourSource/zip/master VapourSource-master.zip] | ||
|} | |} | ||
+ | --> | ||
− | |||
== External Links == | == External Links == | ||
− | *[ | + | *[https://github.com/chikuzen/VapourSource/ GitHub] - Source code repository (v0.1.0 by Chikuzen) |
− | *[ | + | *[https://github.com/Beatrice-Raws/VapourSource GitHub] - Source code repository (v0.2 by DJATOM) |
− | + | ||
<br> | <br> | ||
----------------------------------------------- | ----------------------------------------------- | ||
'''Back to [[External_filters#Source_Filters|External Filters]] ←''' | '''Back to [[External_filters#Source_Filters|External Filters]] ←''' |
Latest revision as of 09:04, 9 July 2020
Abstract | |
---|---|
Author | Chikuzen, DJATOM |
Version | 0.2 |
Download | Releases |
Category | Source filters |
License | GPLv2 |
Discussion | Doom9 Thread |
Contents |
[edit] Description
VapourSource is a VapourSynth script reader for AviSynth+ / AviSynth 2.6.
[edit] Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- VapourSynth R32 or greater (x86 or x64)
- SSE2 capable CPU
- Microsoft Visual C++ 2019 Redistributable Package (x86 / x64)
- *** vcredist_x86.exe is required for VapourSource-x86
- *** vcredist_x64.exe is required for VapourSource-x64
[edit] Supported Formats
VapourSource supports the following formats:
VapourSynth colorspace AviSynth colorspace AviSynth+ colorspace RGB24 RGB24 RGB24 COMPATBGR32 RGB32 RGB32 COMPATYUY2 YUY2 YUY2 GRAY8 Y8 Y8 GRAY16/H Y8 (x2 width) Y16 GRAYS Y8 (x4 width) Y32 YUV420P8 YV12 YV12 YUV420P9/10/16 YV12 (x2 width) YUV420P16 YUV422P8 YV16 YV16 YUV422P9/10/16 YV16 (x2 width) YUV422P16 YUV444P8 YV24 YV24 YUV444P9/10/16 YV24 (x2 width) YUV444P16 YUV444PS YV24 (x4 width) YUV444PS YUV411P8 YV411 YV411 Only constant format/resolution/framerate clips are supported. *Y8/YV12/16/24 allow bit depths >8 using the 16bit interleaved format.
[edit] Syntax and Parameters
[edit] VSImport
Imports an external VapourSynth script (*.vpy).
- VSImport (string source, bool "stacked", int "index", int "prefetch")
- string source =
- Path to VapourSynth script (*.vpy); path can be omitted if the script is in the same folder as the AviSynth script (*.avs).
- string source =
- bool stacked = false
- If this is set to true, MSB/LSB will be separated and be stacked vertically (Stack16).
- bool stacked = false
- int index = 0
- Index of input clip.
- int index = 0
- int prefetch = 0
- Request given amount of frames in advance (MT behaviour). If you have 4 physical cores, set it to 4.
- If AviSynth part of script is too easy in comparison with VS one, It might be good idea to set prefetch to 5. Anyway you can tune it and seek for better performance.
- int prefetch = 0
[edit] VSEval
Evaluates a VapourSynth script inside an AviSynth script, no need for an external script.
- VSEval (string source, bool "stacked", int "index", bool "utf8", int "prefetch")
- string source =
- VapourSynth script to be evaluated.
- string source =
- bool stacked = false
- If this is set to true, MSB/LSB will be separated and be stacked vertically.
- bool stacked = false
- int index = 0
- Index of input clip.
- int index = 0
- bool utf8 = false
- If this is set to true, source is assumed to be UTF-8 encoded (default: false).
- bool utf8 = false
- int prefetch = 0
- Request given amount of frames in advance (MT behaviour). If you have 4 physical cores, set it to 4.
- If AviSynth part of script is too easy in comparison with VS one, It might be good idea to set prefetch to 5. Anyway you can tune it and seek for better performance.
- int prefetch = 0
[edit] Examples
VSImport:
VSImport("script.vpy", stacked=false, index=0, prefetch=4)
VSEval:
script = """ import vapoursynth as vs bc = vs.get_core().std.BlankClip clip0 = bc(format=vs.YUV422P8, color=[0, 128, 128]) clip1 = bc(format=vs.YUV422P8, color=[255, 128, 128]) clip0.set_output(index=0) clip1.set_output(index=1) """ VSEval(source=script, index=1, prefetch=4)
[edit] Changelog
Version Date Changes
0.2 2020/04/06 - reworked prefetch code - re-formatted source
0.1.1 2018/07/19 - add prefetch parameter for multithreading from VapourSynth.
0.1.0 2016/07/05 - support high bit depth formats of AviSynth+ - requires Microsoft Visual C++ 2015 Redistributable Package
0.0.4 2016/05/07 - VS2010 to VS2015 - update avisynth.h, VapourSynth.h and VSScript.h - add 64bit binary
0.0.2 2013/08/06 - fix vertical flip issue on COMPATBGR32. - allow to input a RGB24 clip.
0.0.1 2013/07/31 - initial release
[edit] External Links
- GitHub - Source code repository (v0.1.0 by Chikuzen)
- GitHub - Source code repository (v0.2 by DJATOM)
Back to External Filters ←