Package net.bramp.ffmpeg.builder
Class FFmpegBuilder
java.lang.Object
net.bramp.ffmpeg.builder.FFmpegBuilder
Builds a ffmpeg command line.
- Author:
- bramp
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExtraArgs(String... values) Add additional ouput arguments (for flags which aren't currently supported).addHlsOutput(File file) Adds a new HLS output file.addHlsOutput(String filename) Adds new HLS(Http Live Streaming) output file.addHlsOutput(Path path) Adds a new HLS output file.Adds an input by file.Adds an input by filename or URL.Adds an input by path.addInput(FFmpegProbeResult result) Adds an input from a previously probed result.<T extends AbstractFFmpegInputBuilder<T>>
FFmpegBuilderaddInput(T input) Adds a pre-built input builder and finalizes it.Adds a new output file.Adds new output file.Adds new output file.Adds a new output file.addOutput(FFmpegOutputBuilder output) Adds an existing FFmpegOutputBuilder.addProgress(URI uri) Sets the URI for progress reporting.Create new output (to stdout).build()Builds and returns the list of command-line arguments for ffmpeg.protected voidClears all previously added inputs.protected <T extends AbstractFFmpegInputBuilder<T>>
TdoAddInput(T input) Adds an input builder to the list and returns it for further configuration.booleanReturns whether output files will be overwritten.Returns the pass log file directory.Returns the pass log file prefix.overrideOutputFiles(boolean override) Sets whether to overwrite output files without asking.Deprecated.setAudioFilter(String filter) Sets the audio filter flag.setComplexFilter(String filter) Deprecated.Deprecated.Specify this option on an input stream usingAbstractFFmpegStreamBuilder.setFormat(String)Clears existing inputs and sets the input by file.Clears existing inputs and sets the input by filename or URL.Clears existing inputs and sets the input by path.setInput(FFmpegProbeResult result) Clears existing inputs and sets the input from a probed result.<T extends AbstractFFmpegInputBuilder<T>>
FFmpegBuildersetInput(T input) Sets the input using an input builder, replacing any previous inputs.setPass(int pass) Sets the pass number for multi-pass encoding.setPassDirectory(File directory) Sets the directory for storing pass log files.setPassDirectory(String directory) Sets the directory for storing pass log files.setPassDirectory(Path directory) Sets the directory for storing pass log files.setPassPrefix(String prefix) Sets the pass log file prefix.setStartOffset(long duration, TimeUnit units) Deprecated.Specify this option on an input or output stream usingAbstractFFmpegStreamBuilder.setStartOffset(long, TimeUnit)Sets the strict standards compliance level.setThreads(int threads) Sets the number of threads to use for processing.setUserAgent(String userAgent) Sets the HTTP user agent string.Sets vbr quality when decoding mp3 output.setVerbosity(FFmpegBuilder.Verbosity verbosity) Sets the logging verbosity level.setVideoFilter(String filter) Sets the video filter flag.
-
Field Details
-
strict
-
-
Constructor Details
-
FFmpegBuilder
public FFmpegBuilder()
-
-
Method Details
-
setStrict
Sets the strict standards compliance level. -
overrideOutputFiles
Sets whether to overwrite output files without asking. -
getOverrideOutputFiles
Returns whether output files will be overwritten. -
setPass
Sets the pass number for multi-pass encoding. -
setPassDirectory
Sets the directory for storing pass log files. -
setPassDirectory
Sets the directory for storing pass log files. -
setPassDirectory
Sets the directory for storing pass log files. -
getPassDirectory
Returns the pass log file directory. -
setPassPrefix
Sets the pass log file prefix. -
getPassPrefix
Returns the pass log file prefix. -
setVerbosity
Sets the logging verbosity level. -
setUserAgent
Sets the HTTP user agent string. -
readAtNativeFrameRate
Deprecated.Makes ffmpeg read the first input at the native frame read.- Returns:
- this
-
addInput
Adds an input from a previously probed result. -
addInput
Adds an input by filename or URL. -
addInput
Adds an input by file. -
addInput
Adds an input by path. -
addInput
Adds a pre-built input builder and finalizes it. -
doAddInput
Adds an input builder to the list and returns it for further configuration. -
clearInputs
Clears all previously added inputs. -
setInput
Clears existing inputs and sets the input from a probed result. -
setInput
Clears existing inputs and sets the input by filename or URL. -
setInput
Clears existing inputs and sets the input by file. -
setInput
Clears existing inputs and sets the input by path. -
setInput
Sets the input using an input builder, replacing any previous inputs. -
setThreads
Sets the number of threads to use for processing. -
setFormat
Deprecated.Specify this option on an input stream usingAbstractFFmpegStreamBuilder.setFormat(String)Sets the format for the first input stream.- Parameters:
format- the format of this input stream, not null- Returns:
- this
-
setStartOffset
Deprecated.Specify this option on an input or output stream usingAbstractFFmpegStreamBuilder.setStartOffset(long, TimeUnit)Sets the start offset for the first input stream.- Parameters:
duration- the amount of the offset, measured in terms of the unitunits- the unit that the duration is measured in, not null- Returns:
- this
-
addProgress
Sets the URI for progress reporting. -
setComplexFilter
Deprecated.Sets the complex filter flag.- Parameters:
filter- the complex filter string- Returns:
- this
-
setAudioFilter
Sets the audio filter flag.- Parameters:
filter- the audio filter string- Returns:
- this
-
setVideoFilter
Sets the video filter flag.- Parameters:
filter- the video filter string- Returns:
- this
-
setVBR
Sets vbr quality when decoding mp3 output.- Parameters:
quality- the quality between 0 and 9. Where 0 is best.- Returns:
- FFmpegBuilder
-
addExtraArgs
Add additional ouput arguments (for flags which aren't currently supported).- Parameters:
values- The extra arguments.- Returns:
- this
-
addOutput
Adds new output file.- Parameters:
filename- output file path- Returns:
- A new
FFmpegOutputBuilder
-
addOutput
Adds a new output file. -
addOutput
Adds a new output file. -
addOutput
Adds new output file.- Parameters:
uri- output file uri typically a stream- Returns:
- A new
FFmpegOutputBuilder
-
addOutput
Adds an existing FFmpegOutputBuilder. This is similar to calling the other addOuput methods but instead allows an existing FFmpegOutputBuilder to be used, and reused.List<String> args = new FFmpegBuilder() .addOutput(new FFmpegOutputBuilder() .setFilename("output.flv") .setVideoCodec("flv") ) .build();- Parameters:
output- FFmpegOutputBuilder to add- Returns:
- this
-
addHlsOutput
Adds new HLS(Http Live Streaming) output file.
List<String> args = new FFmpegBuilder() .addHlsOutput("output.m3u8") .done().build();- Parameters:
filename- output file path- Returns:
- A new
FFmpegHlsOutputBuilder
-
addHlsOutput
Adds a new HLS output file. -
addHlsOutput
Adds a new HLS output file. -
addStdoutOutput
Create new output (to stdout).- Returns:
- A new
FFmpegOutputBuilder
-
build
Builds and returns the list of command-line arguments for ffmpeg.
-
AbstractFFmpegInputBuilder.readAtNativeFrameRate()instead