FreeSubPlus

From Avisynth wiki
Jump to: navigation, search
Abstract
Author reel.deel
Version v1.0.0
Download freesubplus-v1.0.0.avsi
Category Subtitling
License
Discussion Doom9 Thread


Contents

Description

FreeSubPlus is a script that adds support for additional colorspaces to the FreeSub plugin.

Requirements

Required Plugins

Latest version of the following plugins are recommended unless stated otherwise.


Syntax and Parameters

FreeSubPlus (clip input, string "text", int "x", int "y", int "first_frame", int "last_frame", string "font", int "size", int "text_color", int "halo_color", int "align", int "lsp", int "font_width", int "halo_width", int "halo_height", string "matrix", string "chromaresample", string "chromaloc", string "output")


clip   =
Input clip; all planar and interleaved colorspaces are supported except YV411. Output will always be planar YUV or RGB.


string  text =
Text to write.


int  x = width/2
int  y = height/2
Anchor point. Actual position of text also depends on alignment.
Default: center of clip (width/2, height/2)


int  first_frame = 0
int  last_frame =
Frames to display subtitle on, inclusive.
Default: first and last frame of the input clip.


string  font = ""
Path to BDF font file. Can be relative to script location.


int  size = 1
Scales the height of the text by an integer multiple of its original size using a point resize.


int  text_color = $20FFFFFF
int  halo_color = $20000000
Text and halo color in ARGB. The first two hex values are for the alpha; 00 is opaque and ff is exactly transparent.
See this page for more information hexadecimal transparency.


int  align = 0
Controls the position of the text relative to the anchor point. Based on the numeric keypad layout.
  • 1,4,7 are left aligned to the right of the anchor point.
  • 2,5,8 are centered (left to right) on the anchor point.
  • 3,6,9 are right aligned to the left of the anchor point.
  • 1,2,3 are bottom aligned to the top of the anchor point.
  • 4,5,6 are centered (top to bottom) on the anchor point.
  • 7,8,9 are top aligned to the bottom of the anchor point


int  lsp =
Setting any value for this turns on multiline mode, which displays multiple line text.
Align properly understands this in both x and y directions. 0 uses the default line spacing.
Negative values put lines of text closer together, which can cause overwriting if things are too close.
Positive values put the lines of text farther apart. These units are multiplied by "size".


int  font_width = size
Like "size", but in the horizontal direction.
Default: same as size


int  halo_width = font_width
Draws a border around the text with this width. Setting 0 effectively disables the border on the sides of text.
Default: same as font_width


int  halo_height = size
Draws a border around the text with this height. Setting 0 effectively disables the border on the top and bottom of text.
If both halo_width and halo_height are 0, there will be no border.
Default: same as size


string  matrix = "Rec709"
Matrix to use on the subtitles for YUV colorspaces. To get accurate colors use the same matrix as the imput clip.
  • "Rec601"  : Uses Rec.601 (SD) coefficients; limited range.
  • "Rec709"  : Uses Rec.709 (HD) coefficients; limited scale range.
  • "Rec2020" : Uses Rec.2020 (UHD) coefficients; limited scale range.
  • "PC.601"  : Uses Rec.601 (SD) coefficients; full scale range.
  • "PC.709"  : Uses Rec.709 (HD) coefficients; full scale range.
  • "Average" : Uses averaged coefficients (the luma becomes the average of the RGB channels); full scale range.
Default: "Rec709"


string  chromaresample = "bicubic"
Resizer to use on the chroma planes when the colorspace of the input clip is YUV420 or YUV422.
Available options: "point", "bilinear", "bicubic", "lanczos", "lanczos4", "blackman", "spline16", "spline36", "spline64", "gauss" and "sinc"
Default: "bicubic"


string  chromaloc = "mpeg2"
Chroma location placement to use for subsampled YUV420 colorspaces only.
  • "mpeg1" : also known as "center" and "jpeg" chroma placement.
  • "mpeg2" : also known as "left" chroma placement, most consumer SD/HD formats use this.
Default: "mpeg2"


string  output = "normal"
Set to "mask" to output the subtitle mask.


Examples

AviSource("Blah.avi")
FreeSubPlus ("AviSynth+", align=5)


Changelog

Version      Date            Changes
v1.0.0 2021/09/06 - Public release


External Links




Back to External Filters

Personal tools