public class Encoder extends Object
| Constructor | Description |
|---|---|
Encoder() |
It builds an encoder using a
DefaultFFMPEGLocator instance to
locate the ffmpeg executable to use. |
Encoder(FFMPEGLocator locator) |
It builds an encoder with a custom
FFMPEGLocator. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
abortEncoding() |
Force the encoding process to stop
|
void |
encode(MultimediaObject multimediaObject,
File target,
EncodingAttributes attributes) |
Re-encode a multimedia file.
|
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(FFMPEGLocator locator)
FFMPEGLocator.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
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.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(MultimediaObject multimediaObject, File target, EncodingAttributes attributes, EncoderProgressListener listener) throws IllegalArgumentException, InputFormatException, EncoderException
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 List<String> getUnhandledMessages()
public void abortEncoding()
Copyright © 2019. All rights reserved.