Package ws.schild.jave.filters
Class Filter
java.lang.Object
ws.schild.jave.filters.Filter
- All Implemented Interfaces:
VideoFilter
- Direct Known Subclasses:
AssSubtitlesFilter,ColorFilter,ConcatFilter,CropFilter,DrawtextFilter,FadeFilter,MediaConcatFilter,MovieFilter,OverlayFilter,PadFilter,ScaleFilter,SetPtsFilter,TrimFilter,ZoomPanFilter
A filter as described by
FFMPEG Documentation.
A filter has an ordered list of input labels, a name, arguments, and an ordered list of output labels. Arguments can be either ordered or named. If both are present, ordered must be emitted first.
Currently filtergraph escaping is not the responsibility of this class. All arguments must be pre-escaped by the time they get to this class.
It is intended that this class is not used directly. Instead, implementers will add a specific implementation of the filter they are implementing. A complete list can be found in FFMPEG Documentation. However, the class is not abstract to not prohibit direct use.
- Author:
- mressler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInputLabel(String... label) Add an input label to the list of input labels for this filteraddNamedArgument(String name, String value) Add a named argument to the set of named arguments for this filteraddOrderedArgument(String... arg) Add an ordered argument to the list of arguments for this filteraddOutputLabel(String... label) Add an output label to the list of output labels for this filterprotected StringescapingPath(String filePath) escaping special characters for file path.The expression to be used in the video filter argument to ffmpegvoidsetQuoteCharacter(String quoteCharacter) Set quoteCharacter of arguments for this filter, Default is double quote.
-
Constructor Details
-
Filter
Create a filter with the specified name with no input/output labels or arguments.- Parameters:
name- The name of the filter.
-
-
Method Details
-
addInputLabel
Add an input label to the list of input labels for this filter- Parameters:
label- The name of the input label(s)- Returns:
- this Filter for builder pattern magic
-
addOrderedArgument
Add an ordered argument to the list of arguments for this filter- Parameters:
arg- Any number of ordered arguments- Returns:
- this Filter for builder pattern magic
-
addNamedArgument
Add a named argument to the set of named arguments for this filter- Parameters:
name- The name of the argumentvalue- The value for the argument- Returns:
- this Filter for builder pattern magic
-
addOutputLabel
Add an output label to the list of output labels for this filter- Parameters:
label- The name of the input label- Returns:
- this Filter for builder pattern magic
-
getExpression
Description copied from interface:VideoFilterThe expression to be used in the video filter argument to ffmpeg- Specified by:
getExpressionin interfaceVideoFilter- Returns:
- A string that will be placed in the -vf or -filter_complex option to ffmpeg.
-
setQuoteCharacter
Set quoteCharacter of arguments for this filter, Default is double quote.- Parameters:
quoteCharacter- The quoteCharacter of arguments
-
escapingPath
escaping special characters for file path. Notes on file url escaping- Parameters:
filePath- unescaped file path- Returns:
- escaped file path
-