Xy-VSFilter
From Avisynth wiki
(Difference between revisions)
(xy-VSFilter: add documentation) |
m (new version .809) |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{FilterCat6|External_filters|Plugins|Plugins_x64|Adjustment_filters|Subtitling|Deep_color_tools}} |
{{Filter3 | {{Filter3 | ||
− | | Gabest, guliverkli2, [https://github.com/Cyberbeing cyberbeing], {{Author/pinterf}} | + | |1=Gabest, guliverkli2, [https://github.com/Cyberbeing cyberbeing], {{Author/pinterf}} |
− | | | + | |2=3.2.0.809 |
− | | [https://github.com/pinterf/xy-VSFilter/releases xyVSFilterSubFilter-pfmod-3.2.0. | + | |3=[https://github.com/pinterf/xy-VSFilter/releases xyVSFilterSubFilter-pfmod-3.2.0.809.7z] |
− | | Subtitling | + | |4=Subtitling |
− | | [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | + | |5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] |
|6= [https://forum.doom9.org/showthread.php?t=168282 Doom9 Forum]}} | |6= [https://forum.doom9.org/showthread.php?t=168282 Doom9 Forum]}} | ||
<br> | <br> | ||
== Description == | == Description == | ||
− | xy-VSFilter Project (High Performance [[VSFilter]] Compatible Subtitle Filters) | + | xy-VSFilter Project (High Performance [[VSFilter]] Compatible Subtitle Filters). Based on VSFilter 2.39 Guliverkli2 with various important changes from VSFilter 2.41 MPC-HC. |
VSFilter includes the following functions: | VSFilter includes the following functions: | ||
− | + | *VobSub | |
− | + | *TextSub | |
− | + | *TextSubSwapUV | |
− | + | *MaskSub | |
<br> | <br> | ||
== Requirements == | == Requirements == | ||
− | * [x86]: [[AviSynth+]] or [ | + | * [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6] |
* [x64]: [[AviSynth+]] | * [x64]: [[AviSynth+]] | ||
− | * Supported color formats: [[RGB24]], [[RGB32]], [[YV12]] | + | * Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]] |
+ | **AviSynth+: <code>TextSub</code> accepts YUV420P10, YUV420P16, YUV422P10 and YUV422P16 formats | ||
<br> | <br> | ||
Line 28: | Line 29: | ||
===TextSub=== | ===TextSub=== | ||
− | Adds subtitles from | + | Adds subtitles from text-based subtitle formats. |
− | <br> | + | |
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Format name<br /> | ||
+ | ! Extension | ||
+ | |- | ||
+ | |[https://en.wikipedia.org/wiki/SubStation_Alpha SubStation Alpha / Advanced SubStation Alpha] | ||
+ | |.ssa / .ass | ||
+ | |- | ||
+ | |[https://en.wikipedia.org/wiki/SubRip SubRip] | ||
+ | |.srt | ||
+ | |- | ||
+ | |[https://en.wikipedia.org/wiki/MicroDVD MicroDVD] | ||
+ | |.sub | ||
+ | |- | ||
+ | |[https://en.wikipedia.org/wiki/SAMI SAMI] | ||
+ | |.smi | ||
+ | |- | ||
+ | |PowerDivX | ||
+ | |.psb | ||
+ | |- | ||
+ | |[https://en.wikipedia.org/wiki/Universal_Subtitle_Format Universal Subtitle Format] | ||
+ | |.usf | ||
+ | |- | ||
+ | |Structured Subtitle Format | ||
+ | |.ssf | ||
+ | |- | ||
+ | |[https://en.wikipedia.org/wiki/WebVTT WebVTT] | ||
+ | |.vtt | ||
+ | |} | ||
+ | |||
<br> | <br> | ||
− | :{{Template:FuncDef|TextSub(clip, string "file", int "charset", float "fps", string "vfr") }} | + | :{{Template:FuncDef|TextSub (clip, string "file", int "charset", float "fps", string "vfr") }} |
<br> | <br> | ||
::{{Par2||clip| }} | ::{{Par2||clip| }} | ||
Line 40: | Line 71: | ||
<br> | <br> | ||
::{{Par2|charset|int|1}} | ::{{Par2|charset|int|1}} | ||
− | ::: | + | :::''charset'' is the encoding to assume the file is in, if it's not Unicode UTF-8 or UTF-16. (If you need to use this you're doing something wrong.) |
<br> | <br> | ||
::{{Par2|fps|float|-1.0}} | ::{{Par2|fps|float|-1.0}} | ||
− | ::: | + | :::''fps'' is the FPS to assume the video is at. You could just as well just use <code>AssumeFPS</code> instead of using this. VFR overrides this. |
<br> | <br> | ||
::{{Par2|vfr|string|""}} | ::{{Par2|vfr|string|""}} | ||
− | ::: | + | :::''vfr'' is the path to the VFR timecodes file (format 1 or 2) to use for frame times. If set, overrides all other FPS specifications. |
<br> | <br> | ||
+ | |||
===VobSub=== | ===VobSub=== | ||
− | Adds subtitles | + | Adds image-based subtitles in VobSub format. It consists of an *.idx file that stores the subtitle properties and a .sub file that contains the binary data.. |
<br> | <br> | ||
<br> | <br> | ||
− | :{{Template:FuncDef|VobSub (clip, string | + | :{{Template:FuncDef|VobSub (clip, string) }} |
<br> | <br> | ||
::{{Par2||clip| }} | ::{{Par2||clip| }} | ||
:::Input clip. | :::Input clip. | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2| |string| }} |
:::Path to subtitles file, only .idx and .sub files supported. | :::Path to subtitles file, only .idx and .sub files supported. | ||
<br> | <br> | ||
===MaskSub=== | ===MaskSub=== | ||
− | Creates a subtitle mask. See [https://sourceforge.net/p/guliverkli2/patches/1/ here] for more info. | + | Creates a subtitle mask. <!--See [https://sourceforge.net/p/guliverkli2/patches/1/ here] for more info.--> |
<br> | <br> | ||
<br> | <br> | ||
− | :{{Template:FuncDef| | + | :{{Template:FuncDef|MaskSub (string "file", int "width", int "height", float "fps", int "length", int "charset", string "vfr", string "pixel_type") }} |
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|file|string|}} |
− | + | ||
− | + | ||
− | + | ||
:::Path to subtitles file. | :::Path to subtitles file. | ||
<br> | <br> | ||
::{{Par2|width|int| }} | ::{{Par2|width|int| }} | ||
::{{Par2|height|int| }} | ::{{Par2|height|int| }} | ||
− | ::: | + | :::''width'' and ''height'' specify the size of the generated clip, in pixels. |
<br> | <br> | ||
::{{Par2|fps|float| }} | ::{{Par2|fps|float| }} | ||
− | ::: | + | :::''fps'' specifies the framerate of the generated clip. |
<br> | <br> | ||
::{{Par2|length|int| }} | ::{{Par2|length|int| }} | ||
− | ::: | + | :::''length'' is the number of frames to produce in the clip. |
<br> | <br> | ||
::{{Par2|charset|int| }} | ::{{Par2|charset|int| }} | ||
− | ::: | + | :::''charset'' is the encoding to assume the file is in, if it's not Unicode UTF-8 or UTF-16. (If you need to use this you're doing something wrong.) |
<br> | <br> | ||
::{{Par2|vfr|string|""}} | ::{{Par2|vfr|string|""}} | ||
− | ::: | + | :::''vfr'' is the path to the VFR timecodes file (format 1 or 2) to use for frame times. |
<br> | <br> | ||
::{{Par2|pixel_type|string|"RGB32"}} | ::{{Par2|pixel_type|string|"RGB32"}} | ||
:::Pixel type, can be set to: <code>"RGB32", "YUV420P10" or "YUV420P16"</code> | :::Pixel type, can be set to: <code>"RGB32", "YUV420P10" or "YUV420P16"</code> | ||
+ | :::<s>'''Note:''' With "RGB32" output the mask is flipped vertically, use <code>[[FlipVertical]]()</code> to correct it.</s> - Fixed in v3.2.0.808 | ||
<br> | <br> | ||
+ | |||
===TextSubSwapUV=== | ===TextSubSwapUV=== | ||
− | |||
− | |||
<br> | <br> | ||
− | :{{Template:FuncDef|TextSubSwapUV (bool | + | :{{Template:FuncDef|TextSubSwapUV (bool) }} |
<br> | <br> | ||
::{{Par2||clip| }} | ::{{Par2||clip| }} | ||
:::Input clip. | :::Input clip. | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2| |bool|false}} |
− | ::: | + | :::Toggles (globally) whether to swap assume the U and V planes are swapped in YV12 video when rendering subtitles. Default is false. |
<br> | <br> | ||
Line 107: | Line 136: | ||
[[AviSource]]("Blah.avi") | [[AviSource]]("Blah.avi") | ||
TextSub(file="subtitle.ass") | TextSub(file="subtitle.ass") | ||
+ | |||
+ | #Assume clip is 1280x720, 24fps, and 3,000 frames total | ||
+ | MaskSub(file="subtitle.ass", width=1280, height=720, fps=24, length=3000) | ||
+ | <br> | ||
+ | #or alternatively you can get the [[Clip_properties|clip properties]] | ||
+ | video = AviSource("Blah.avi") | ||
+ | MaskSub(file="subtitle.ass", width=video.Width(), height=video.Height(), fps=video.FrameRate(), length=video.FrameCount()) | ||
[[AviSource]]("Blah.avi") | [[AviSource]]("Blah.avi") | ||
− | VobSub( | + | VobSub("subtitle.sub") |
<br> | <br> | ||
Line 119: | Line 155: | ||
== External Links == | == External Links == | ||
− | *[https://github.com/pinterf/xy-VSFilter GitHub] - Source code repository (latest version). | + | *[https://github.com/pinterf/xy-VSFilter GitHub] - Source code repository (latest version from pinterf). |
− | . | + | *[https://github.com/HomeOfVapourSynthEvolution/xy-VSFilter GitHub] - xy-VSFilter with VapourSynth interface added, based on pinterf's fork |
<br> | <br> | ||
<br> | <br> | ||
----------------------------------------------- | ----------------------------------------------- | ||
'''Back to [[External_filters#Subtitling|External Filters]] ←''' | '''Back to [[External_filters#Subtitling|External Filters]] ←''' |
Latest revision as of 09:29, 4 January 2024
Abstract | |
---|---|
Author | Gabest, guliverkli2, cyberbeing, pinterf |
Version | 3.2.0.809 |
Download | xyVSFilterSubFilter-pfmod-3.2.0.809.7z |
Category | Subtitling |
License | GPLv2 |
Discussion | Doom9 Forum |
Contents |
[edit] Description
xy-VSFilter Project (High Performance VSFilter Compatible Subtitle Filters). Based on VSFilter 2.39 Guliverkli2 with various important changes from VSFilter 2.41 MPC-HC.
VSFilter includes the following functions:
- VobSub
- TextSub
- TextSubSwapUV
- MaskSub
[edit] Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Supported color formats: RGB24, RGB32, YUY2, YV12, YV16, YV24
- AviSynth+:
TextSub
accepts YUV420P10, YUV420P16, YUV422P10 and YUV422P16 formats
- AviSynth+:
[edit] Syntax and Parameters
[edit] TextSub
Adds subtitles from text-based subtitle formats.
Format name |
Extension |
---|---|
SubStation Alpha / Advanced SubStation Alpha | .ssa / .ass |
SubRip | .srt |
MicroDVD | .sub |
SAMI | .smi |
PowerDivX | .psb |
Universal Subtitle Format | .usf |
Structured Subtitle Format | .ssf |
WebVTT | .vtt |
- TextSub (clip, string "file", int "charset", float "fps", string "vfr")
- clip =
- Input clip.
- clip =
- string file =
- Path to subtitles file.
- string file =
- int charset = 1
- charset is the encoding to assume the file is in, if it's not Unicode UTF-8 or UTF-16. (If you need to use this you're doing something wrong.)
- int charset = 1
- float fps = -1.0
- fps is the FPS to assume the video is at. You could just as well just use
AssumeFPS
instead of using this. VFR overrides this.
- fps is the FPS to assume the video is at. You could just as well just use
- float fps = -1.0
- string vfr = ""
- vfr is the path to the VFR timecodes file (format 1 or 2) to use for frame times. If set, overrides all other FPS specifications.
- string vfr = ""
[edit] VobSub
Adds image-based subtitles in VobSub format. It consists of an *.idx file that stores the subtitle properties and a .sub file that contains the binary data..
- VobSub (clip, string)
- clip =
- Input clip.
- clip =
- string =
- Path to subtitles file, only .idx and .sub files supported.
- string =
[edit] MaskSub
Creates a subtitle mask.
- MaskSub (string "file", int "width", int "height", float "fps", int "length", int "charset", string "vfr", string "pixel_type")
- string file =
- Path to subtitles file.
- string file =
- int width =
- int height =
- width and height specify the size of the generated clip, in pixels.
- int width =
- float fps =
- fps specifies the framerate of the generated clip.
- float fps =
- int length =
- length is the number of frames to produce in the clip.
- int length =
- int charset =
- charset is the encoding to assume the file is in, if it's not Unicode UTF-8 or UTF-16. (If you need to use this you're doing something wrong.)
- int charset =
- string vfr = ""
- vfr is the path to the VFR timecodes file (format 1 or 2) to use for frame times.
- string vfr = ""
- string pixel_type = "RGB32"
- Pixel type, can be set to:
"RGB32", "YUV420P10" or "YUV420P16"
Note: With "RGB32" output the mask is flipped vertically, use- Fixed in v3.2.0.808FlipVertical()
to correct it.
- Pixel type, can be set to:
- string pixel_type = "RGB32"
[edit] TextSubSwapUV
- TextSubSwapUV (bool)
- clip =
- Input clip.
- clip =
- bool = false
- Toggles (globally) whether to swap assume the U and V planes are swapped in YV12 video when rendering subtitles. Default is false.
- bool = false
[edit] Examples
AviSource("Blah.avi") TextSub(file="subtitle.ass")
#Assume clip is 1280x720, 24fps, and 3,000 frames total MaskSub(file="subtitle.ass", width=1280, height=720, fps=24, length=3000)
#or alternatively you can get the clip properties video = AviSource("Blah.avi") MaskSub(file="subtitle.ass", width=video.Width(), height=video.Height(), fps=video.FrameRate(), length=video.FrameCount())
AviSource("Blah.avi") VobSub("subtitle.sub")
[edit] Changelog
See GitHub releases page: https://github.com/pinterf/xy-VSFilter/releases
[edit] External Links
- GitHub - Source code repository (latest version from pinterf).
- GitHub - xy-VSFilter with VapourSynth interface added, based on pinterf's fork
Back to External Filters ←