VSFilterMod
From Avisynth wiki
(Difference between revisions)
(add VobSub documentation) |
(update links and add info on subtitle formats) |
||
(9 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
{{FilterCat5|External_filters|Plugins|Plugins_x64|Adjustment_filters|Subtitling}} | {{FilterCat5|External_filters|Plugins|Plugins_x64|Adjustment_filters|Subtitling}} | ||
{{Filter3 | {{Filter3 | ||
− | | Gabest, guliverkli2, and others | + | |1=Gabest, guliverkli2, and others |
− | | | + | |2=r5.2.7b |
− | | [https://github.com/ | + | |3=[https://github.com/computerfan/VSFilterMod/releases VSFilterMod_bin_r527b_vmod.zip] |
− | | Subtitling | + | |4=Subtitling |
− | | [http://www.gnu.org/licenses/gpl- | + | |5=[http://www.gnu.org/licenses/gpl-3.0.txt GPLv3] |
|6= [http://forum.doom9.org/showthread.php?t=152855 Doom9 Forum]}} | |6= [http://forum.doom9.org/showthread.php?t=152855 Doom9 Forum]}} | ||
<br> | <br> | ||
Line 12: | Line 12: | ||
VSFilterMod includes the following funtions: | VSFilterMod includes the following funtions: | ||
− | + | *VobSub | |
− | + | *TextSubMod | |
+ | *MaskSubMod | ||
+ | *TextSubModSwapUV | ||
<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]] |
<br> | <br> | ||
Line 26: | Line 28: | ||
===TextSubMod=== | ===TextSubMod=== | ||
− | 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 | ||
+ | |} | ||
<br> | <br> | ||
− | :{{Template:FuncDef|TextSubMod(clip, string file, int "charset", float "fps", string "vfr") }} | + | :{{Template:FuncDef|TextSubMod (clip, string "file", int "charset", float "fps", string "vfr") }} |
<br> | <br> | ||
::{{Par2||clip| }} | ::{{Par2||clip| }} | ||
:::Input clip. | :::Input clip. | ||
<br> | <br> | ||
− | ::{{Par2||string|}} | + | ::{{Par2|file|string|}} |
:::Path to subtitles file. | :::Path to subtitles file. | ||
<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||string|}} | + | ::{{Par2| |string| }} |
:::Path to subtitles file, only .idx and .sub files supported. | :::Path to subtitles file, only .idx and .sub files supported. | ||
+ | <br> | ||
+ | ===MaskSubMod=== | ||
+ | Creates a subtitle mask clip. Output clip is RGB32 and it is flipped vertically, use <code>[[FlipVertical]]()</code> to correct it. | ||
+ | <br> | ||
+ | <br> | ||
+ | :{{Template:FuncDef|MaskSubMod (string "file", int "width", int "height", float "fps", int "length", int "charset", string "vfr") }} | ||
+ | <br> | ||
+ | ::{{Par2|file|string|}} | ||
+ | :::Path to subtitles file. | ||
+ | <br> | ||
+ | ::{{Par2|width|int| }} | ||
+ | ::{{Par2|height|int| }} | ||
+ | :::''width'' and ''height'' specify the size of the generated clip, in pixels. | ||
+ | <br> | ||
+ | ::{{Par2|fps|float| }} | ||
+ | :::''fps'' specifies the framerate of the generated clip. | ||
+ | <br> | ||
+ | ::{{Par2|length|int| }} | ||
+ | :::''length'' is the number of frames to produce in the clip. | ||
+ | <br> | ||
+ | ::{{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> | ||
+ | ::{{Par2|vfr|string|""}} | ||
+ | :::''vfr'' is the path to the VFR timecodes file (format 1 or 2) to use for frame times. | ||
+ | <br> | ||
+ | |||
+ | ===TextSubModSwapUV=== | ||
+ | <br> | ||
+ | :{{Template:FuncDef|TextSubModSwapUV (bool) }} | ||
+ | <br> | ||
+ | ::{{Par2||clip| }} | ||
+ | :::Input clip. | ||
+ | <br> | ||
+ | ::{{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> | ||
== Examples == | == Examples == | ||
[[AviSource]]("Blah.avi") | [[AviSource]]("Blah.avi") | ||
− | TextSubMod("subtitle.ass") | + | TextSubMod(file="subtitle.ass") |
+ | |||
+ | #Assume clip is 1280x720, 24fps, and 3,000 frames total | ||
+ | MaskSubMod(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") | ||
+ | MaskSubMod(file="subtitle.ass", width=video.Width(), height=video.Height(), fps=video.FrameRate(), length=video.FrameCount()) | ||
[[AviSource]]("Blah.avi") | [[AviSource]]("Blah.avi") | ||
Line 69: | Line 141: | ||
== Changelog == | == Changelog == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | r5.2.7b - See changes here: https://github.com/computerfan/VSFilterMod/releases | |
− | + | r5.2.7 - Correctly handle luma values for full range yuv during alpha blending | |
− | + | - Fix wrong LSB when working with 10/16 bit clips | |
− | + | - Fix yoffset of $img texture being affected when using clip/iclip | |
− | + | - Fix repeated scaling of opaque box | |
− | + | - Fix $va: body part of outline should not be drawn when va is applied | |
− | + | - by @computerfan | |
− | + | r5.2.6 2022/05/21 - Fix use of iclip and movevc with larger values causing content invisible | |
− | + | r5.2.5 2021/05/30 - fix: render for internal subtitles | |
− | + | r5.2.4 2021/02/26 - fix possible crashes of invaild drawing | |
− | + | - fix wrong handle of frx fry tag in different resolutions | |
− | + | - fix the problem of drawing accuracy | |
− | + | - fix crash when update details is empty | |
− | + | - changes by [https://github.com/Masaiki/VSFilterMod/ Masaiki] | |
− | + | r5.2.3 2020/08/08 - fix default value of matrix and range | |
− | + | - add YCbCr Matrix (TV601 TV709 TV2020) support | |
− | + | r5.2.2 2020/04/03 - Fix \frx and \fry reversed | |
− | + | r5.2.1 2019/07/07 - Add support for Unicode SMP | |
− | + | r5.2 2018/08/14 - enable non-ascii filename. | |
+ | r5 2018/04/09 - support YUV420P10 and YUV420P16 for vapoursynth. | ||
<br> | <br> | ||
== External Links == | == External Links == | ||
− | *[https://github.com/sorayuki/VSFilterMod GitHub] - Source code repository ( | + | *[https://github.com/sorayuki/VSFilterMod GitHub] - Source code repository (Sorayuki r5.2.5). |
*[http://code.google.com/archive/p/vsfiltermod/ Google Code Archive] - Source code repository (original VSFilterMod). | *[http://code.google.com/archive/p/vsfiltermod/ Google Code Archive] - Source code repository (original VSFilterMod). | ||
<br> | <br> |
Latest revision as of 18:48, 15 January 2023
Abstract | |
---|---|
Author | Gabest, guliverkli2, and others |
Version | r5.2.7b |
Download | VSFilterMod_bin_r527b_vmod.zip |
Category | Subtitling |
License | GPLv3 |
Discussion | Doom9 Forum |
Contents |
[edit] Description
VSFilterMod is modification of original VSFilter subtitle renderer by Gabest. This mod brings up new features and some minor bugfixes.
VSFilterMod includes the following funtions:
- VobSub
- TextSubMod
- MaskSubMod
- TextSubModSwapUV
[edit] Requirements
[edit] Syntax and Parameters
[edit] TextSubMod
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 |
- TextSubMod (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] MaskSubMod
Creates a subtitle mask clip. Output clip is RGB32 and it is flipped vertically, use FlipVertical()
to correct it.
- MaskSubMod (string "file", int "width", int "height", float "fps", int "length", int "charset", string "vfr")
- 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 = ""
[edit] TextSubModSwapUV
- TextSubModSwapUV (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") TextSubMod(file="subtitle.ass")
#Assume clip is 1280x720, 24fps, and 3,000 frames total MaskSubMod(file="subtitle.ass", width=1280, height=720, fps=24, length=3000)
#or alternatively you can get the clip properties video = AviSource("Blah.avi") MaskSubMod(file="subtitle.ass", width=video.Width(), height=video.Height(), fps=video.FrameRate(), length=video.FrameCount())
AviSource("Blah.avi") VobSub("subtitle.sub")
[edit] Changelog
r5.2.7b - See changes here: https://github.com/computerfan/VSFilterMod/releases r5.2.7 - Correctly handle luma values for full range yuv during alpha blending - Fix wrong LSB when working with 10/16 bit clips - Fix yoffset of $img texture being affected when using clip/iclip - Fix repeated scaling of opaque box - Fix $va: body part of outline should not be drawn when va is applied - by @computerfan r5.2.6 2022/05/21 - Fix use of iclip and movevc with larger values causing content invisible r5.2.5 2021/05/30 - fix: render for internal subtitles r5.2.4 2021/02/26 - fix possible crashes of invaild drawing - fix wrong handle of frx fry tag in different resolutions - fix the problem of drawing accuracy - fix crash when update details is empty - changes by Masaiki r5.2.3 2020/08/08 - fix default value of matrix and range - add YCbCr Matrix (TV601 TV709 TV2020) support r5.2.2 2020/04/03 - Fix \frx and \fry reversed r5.2.1 2019/07/07 - Add support for Unicode SMP r5.2 2018/08/14 - enable non-ascii filename. r5 2018/04/09 - support YUV420P10 and YUV420P16 for vapoursynth.
[edit] External Links
- GitHub - Source code repository (Sorayuki r5.2.5).
- Google Code Archive - Source code repository (original VSFilterMod).
Back to External Filters ←