public class Encoder extends Object
| Constructor and Description |
|---|
Encoder()
It builds an encoder using a
DefaultFFMPEGLocator instance to locate the ffmpeg
executable to use. |
Encoder(ProcessLocator locator)
It builds an encoder with a custom
FFMPEGProcess. |
| Modifier and Type | Method and Description |
|---|---|
void |
abortEncoding()
Force the encoding process to stop
|
static void |
addOptionAtIndex(EncodingArgument arg,
Integer index) |
void |
encode(List<MultimediaObject> multimediaObjects,
File target,
EncodingAttributes attributes) |
void |
encode(List<MultimediaObject> multimediaObjects,
File target,
EncodingAttributes attributes,
EncoderProgressListener listener)
Re-encode a multimedia file(s).
|
void |
encode(MultimediaObject multimediaObject,
File target,
EncodingAttributes attributes)
Re-encode a multimedia file(s).
|
void |
encode(MultimediaObject multimediaObject,
File target,
EncodingAttributes attributes,
EncoderProgressListener listener)
Re-encode a multimedia file.
|
String[] |
getAudioDecoders()
Returns a list with the names of all the audio decoders bundled with the ffmpeg distribution in
use.
|
String[] |
getAudioEncoders()
Returns a list with the names of all the audio encoders bundled with the ffmpeg distribution in
use.
|
protected String[] |
getCoders(boolean encoder,
boolean audio)
Returns a list with the names of all the coders bundled with the ffmpeg distribution in use.
|
protected String[] |
getSupportedCodingFormats(boolean encoding)
Returns a list with the names of all the file formats supported at en/de-coding time by the
underlying ffmpeg distribution.A multimedia file could be encoded and generated only if the
specified format is in this list.
|
String[] |
getSupportedDecodingFormats()
Returns a list with the names of all the file formats supported at decoding time by the
underlying ffmpeg distribution.
|
String[] |
getSupportedEncodingFormats()
Returns a list with the names of all the file formats supported at encoding time by the
underlying ffmpeg distribution.
|
List<String> |
getUnhandledMessages()
Return the list of unhandled output messages of the ffmpeng encoder run
|
String[] |
getVideoDecoders()
Returns a list with the names of all the video decoders bundled with the ffmpeg distribution in
use.
|
String[] |
getVideoEncoders()
Returns a list with the names of all the video encoders bundled with the ffmpeg distribution in
use.
|
public Encoder()
DefaultFFMPEGLocator instance to locate the ffmpeg
executable to use.public Encoder(ProcessLocator locator)
FFMPEGProcess.locator - The locator picking up the ffmpeg executable used by the encoder.public String[] getAudioDecoders() throws EncoderException
EncoderException - If a problem occurs calling the underlying ffmpeg executable.public String[] getAudioEncoders() throws EncoderException
EncoderException - If a problem occurs calling the underlying ffmpeg executable.protected String[] getCoders(boolean encoder, boolean audio) throws EncoderException
encoder - Do search encoders, else decodersaudio - Do search for audio encodes, else videoEncoderException - If a problem occurs calling the underlying ffmpeg executable.public String[] getVideoDecoders() throws EncoderException
EncoderException - If a problem occurs calling the underlying ffmpeg executable.public String[] getVideoEncoders() throws EncoderException
EncoderException - If a problem occurs calling the underlying ffmpeg executable.public String[] getSupportedEncodingFormats() throws EncoderException
EncoderException - If a problem occurs calling the underlying ffmpeg executable.protected String[] getSupportedCodingFormats(boolean encoding) throws EncoderException
encoding - True for encoding job, false to decode a fileEncoderException - If a problem occurs calling the underlying ffmpeg executable.public String[] getSupportedDecodingFormats() throws EncoderException
EncoderException - If a problem occurs calling the underlying ffmpeg executable.public void encode(MultimediaObject multimediaObject, File target, EncodingAttributes attributes) throws IllegalArgumentException, InputFormatException, EncoderException
This method is not reentrant, instead create multiple object instances
multimediaObject - The source multimedia file. It cannot be null. Be sure this file can be
decoded (see null null null null getSupportedDecodingFormats(), getAudioDecoders() and getVideoDecoders()). When passing multiple
sources, make sure that they are compatible in the way that ffmpeg can concat them. We
don't use the complex filter at the moment Perhaps you will need to first transcode/resize
them https://trac.ffmpeg.org/wiki/Concatenate @see "Concat protocol"target - The target multimedia re-encoded file. It cannot be null. If this file already
exists, it will be overwrited.attributes - A set of attributes for the encoding process.IllegalArgumentException - If both audio and video parameters are null.InputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.public void encode(List<MultimediaObject> multimediaObjects, File target, EncodingAttributes attributes) throws IllegalArgumentException, InputFormatException, EncoderException
public void encode(MultimediaObject multimediaObject, File target, EncodingAttributes attributes, EncoderProgressListener listener) throws IllegalArgumentException, InputFormatException, EncoderException
This method is not reentrant, instead create multiple object instances
multimediaObject - The source multimedia file. It cannot be null. Be sure this file can be
decoded (see null null null null getSupportedDecodingFormats(), getAudioDecoders() and getVideoDecoders()).target - The target multimedia re-encoded file. It cannot be null. If this file already
exists, it will be overwrited.attributes - A set of attributes for the encoding process.listener - An optional progress listener for the encoding process. It can be null.IllegalArgumentException - If both audio and video parameters are null.InputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.public static void addOptionAtIndex(EncodingArgument arg, Integer index)
public void encode(List<MultimediaObject> multimediaObjects, File target, EncodingAttributes attributes, EncoderProgressListener listener) throws IllegalArgumentException, InputFormatException, EncoderException
This method is not reentrant, instead create multiple object instances
multimediaObjects - The source multimedia files. It cannot be null. Be sure this file can
be decoded (see null null null null getSupportedDecodingFormats(), getAudioDecoders() and* getVideoDecoders()) When passing multiple
sources, make sure that they are compatible in the way that ffmpeg can concat them. We
don't use the complex filter at the moment Perhaps you will need to first transcode/resize
them https://trac.ffmpeg.org/wiki/Concatenate @see "Concat protocol"target - The target multimedia re-encoded file. It cannot be null. If this file already
exists, it will be overwrited.attributes - A set of attributes for the encoding process.listener - An optional progress listener for the encoding process. It can be null.IllegalArgumentException - If both audio and video parameters are null.InputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.public List<String> getUnhandledMessages()
public void abortEncoding()
Copyright © 2020. All rights reserved.