public class DrawtextFilter extends Filter
https://write.corbpie.com/how-to-do-a-text-watermark-in-ffmpeg/ -vf "drawtext=text='a watermark':x=10:y=H-th-10:fontfile=/pathto/font.ttf:fontsize=10:fontcolor=white:shadowcolor=black:shadowx=2:shadowy=2"
| Constructor and Description |
|---|
DrawtextFilter(String text,
String posX,
String posY) |
DrawtextFilter(String text,
String posX,
String posY,
File fontFile,
Double fontSize,
Color fontColor) |
DrawtextFilter(String text,
String posX,
String posY,
String fontName,
Double fontSize,
Color fontColor) |
| Modifier and Type | Method and Description |
|---|---|
DrawtextFilter |
setBorder(Integer borderWidth,
Color color) |
DrawtextFilter |
setBox(Integer borderWidth,
Color color)
Used to draw a box around text using the background color.
|
DrawtextFilter |
setLineSpacing(Integer lineSpacing) |
DrawtextFilter |
setShadow(Color shadowColor,
Integer shadowX,
Integer shadowY) |
addInputLabel, addNamedArgument, addOrderedArgument, addOutputLabel, getExpressionpublic DrawtextFilter(String text, String posX, String posY)
text - The text string to be drawn. The text must be a sequence of UTF-8 encoded
characters. This parameter is mandatory if no file is specified with the parameter
textfile.posX - X Position of watermark text. The expressions which specify the offsets where text
will be drawn within the video frame. They are relative to the top/left border of the
output image. The default value of x and y is "0".posY - Y Position of watermark text. The expressions which specify the offsets where text
will be drawn within the video frame. They are relative to the top/left border of the
output image. The default value of x and y is "0".public DrawtextFilter(String text, String posX, String posY, String fontName, Double fontSize, Color fontColor) throws IllegalArgumentException
text - The text string to be drawn. The text must be a sequence of UTF-8 encoded
characters. This parameter is mandatory if no file is specified with the parameter
textfile.posX - X Position of watermark text. The expressions which specify the offsets where text
will be drawn within the video frame. They are relative to the top/left border of the
output image. The default value of x and y is "0".posY - Y Position of watermark text. The expressions which specify the offsets where text
will be drawn within the video frame. They are relative to the top/left border of the
output image. The default value of x and y is "0".fontName - The font family to be used for drawing text. By default Sans.fontSize - The font size to be used for drawing text. The default value of fontsize is 16.fontColor - The color to be used for drawing fonts. The default value of fontcolor is
"black".IllegalArgumentExceptionpublic DrawtextFilter(String text, String posX, String posY, File fontFile, Double fontSize, Color fontColor) throws IllegalArgumentException
text - The text string to be drawn. The text must be a sequence of UTF-8 encoded
characters. This parameter is mandatory if no file is specified with the parameter
textfile.posX - X Position of watermark text. The expressions which specify the offsets where text
will be drawn within the video frame. They are relative to the top/left border of the
output image. The default value of x and y is "0".posY - Y Position of watermark text. The expressions which specify the offsets where text
will be drawn within the video frame. They are relative to the top/left border of the
output image. The default value of x and y is "0".fontFile - The font file to be used for drawing text. The path must be included. This
parameter is mandatory if the fontconfig support is disabled.fontSize - The font size to be used for drawing text. The default value of fontsize is 16.fontColor - The color to be used for drawing fonts. The default value of fontcolor is
"black".IllegalArgumentExceptionpublic DrawtextFilter setShadow(Color shadowColor, Integer shadowX, Integer shadowY)
shadowColor - Color of shadowshadowX - X Position of shadow, relative to textshadowY - Y Position of shadow, relative to textpublic DrawtextFilter setBox(Integer borderWidth, Color color)
borderWidth - Set the width of the border to be drawn around the box using boxcolor. The
default value of boxborderw is 0.color - The color to be used for drawing box around text. The default value of boxcolor is
"white".public DrawtextFilter setBorder(Integer borderWidth, Color color)
borderWidth - Set the width of the border to be drawn around the text using bordercolor.
The default value of borderw is 0.color - Set the color to be used for drawing border around text. The default value of
bordercolor is "black".public DrawtextFilter setLineSpacing(Integer lineSpacing)
lineSpacing - Set the line spacing in pixels of the border to be drawn around the box
using box. The default value of line_spacing is 0.Copyright © 2020. All rights reserved.