Package net.bramp.ffmpeg
Class FFmpeg
java.lang.Object
net.bramp.ffmpeg.FFmpeg
Wrapper around FFmpeg.
- Author:
- bramp
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final StringDeprecated.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Fractionstatic final Fractionstatic final Fractionstatic final Fraction -
Constructor Summary
ConstructorsConstructorDescriptionFFmpeg()Constructs an FFmpeg instance using the default path.Constructs an FFmpeg instance using the specified path.FFmpeg(String path, ProcessFunction runFunction) Constructs an FFmpeg instance using the specified path and process function.FFmpeg(ProcessFunction runFunction) Constructs an FFmpeg instance using the default path and the specified process function. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a new FFmpegBuilder instance.Returns the list of supported channel layouts.codecs()Returns the list of supported codecs.protected ProgressParsercreateProgressParser(ProgressListener listener) Creates a progress parser for the given listener.filters()Returns the list of supported filters.formats()Returns the list of supported formats.getPath()booleanisFFmpeg()Returns true if the binary we are using is the true ffmpeg.Returns the full path to the binary with arguments appended.Returns the list of supported pixel formats.voidRuns the binary (ffmpeg) with the supplied args.voidrun(FFmpegBuilder builder) Runs ffmpeg with the supplied builder.voidrun(FFmpegBuilder builder, ProgressListener listener) Runs ffmpeg with the supplied builder and an optional progress listener.voidsetProcessErrorStream(Appendable processErrorStream) voidsetProcessOutputStream(Appendable processOutputStream) protected voidprotected voidthrowOnError(Process p, FFmpegProbeResult result) version()Returns the version string for this binary.protected BufferedReaderprotected BufferedReader
-
Field Details
-
FFMPEG
- See Also:
-
DEFAULT_PATH
-
FPS_30
-
FPS_29_97
-
FPS_24
-
FPS_23_976
-
AUDIO_MONO
- See Also:
-
AUDIO_STEREO
- See Also:
-
AUDIO_FORMAT_U8
- See Also:
-
AUDIO_FORMAT_S16
- See Also:
-
AUDIO_FORMAT_S32
- See Also:
-
AUDIO_FORMAT_FLT
- See Also:
-
AUDIO_FORMAT_DBL
- See Also:
-
AUDIO_DEPTH_U8
Deprecated.- See Also:
-
AUDIO_DEPTH_S16
Deprecated.- See Also:
-
AUDIO_DEPTH_S32
Deprecated.- See Also:
-
AUDIO_DEPTH_FLT
Deprecated.- See Also:
-
AUDIO_DEPTH_DBL
Deprecated.- See Also:
-
AUDIO_SAMPLE_8000
- See Also:
-
AUDIO_SAMPLE_11025
- See Also:
-
AUDIO_SAMPLE_12000
- See Also:
-
AUDIO_SAMPLE_16000
- See Also:
-
AUDIO_SAMPLE_22050
- See Also:
-
AUDIO_SAMPLE_32000
- See Also:
-
AUDIO_SAMPLE_44100
- See Also:
-
AUDIO_SAMPLE_48000
- See Also:
-
AUDIO_SAMPLE_96000
- See Also:
-
-
Constructor Details
-
FFmpeg
Constructs an FFmpeg instance using the default path.- Throws:
IOException
-
FFmpeg
Constructs an FFmpeg instance using the default path and the specified process function.- Throws:
IOException
-
FFmpeg
Constructs an FFmpeg instance using the specified path.- Throws:
IOException
-
FFmpeg
Constructs an FFmpeg instance using the specified path and process function.- Throws:
IOException
-
-
Method Details
-
isFFmpeg
Returns true if the binary we are using is the true ffmpeg. This is to avoid conflict with avconv (from the libav project), that some symlink to ffmpeg.- Returns:
- true iff this is the official ffmpeg binary.
- Throws:
IOException- If a I/O error occurs while executing ffmpeg.
-
codecs
Returns the list of supported codecs.- Throws:
IOException
-
filters
Returns the list of supported filters.- Throws:
IOException
-
formats
Returns the list of supported formats.- Throws:
IOException
-
pixelFormats
Returns the list of supported pixel formats.- Throws:
IOException
-
channelLayouts
Returns the list of supported channel layouts.- Throws:
IOException
-
createProgressParser
Creates a progress parser for the given listener.- Throws:
IOException
-
run
Runs the binary (ffmpeg) with the supplied args. Blocking until finished.- Parameters:
args- The arguments to pass to the binary.- Throws:
IOException- If there is a problem executing the binary.
-
run
Runs ffmpeg with the supplied builder.- Throws:
IOException
-
run
Runs ffmpeg with the supplied builder and an optional progress listener.- Parameters:
builder- the ffmpeg builderlistener- optional progress listener- Throws:
IOException- if an I/O error occurs
-
builder
Returns a new FFmpegBuilder instance. -
getPath
-
setProcessOutputStream
-
setProcessErrorStream
-
wrapInReader
-
wrapErrorInReader
-
throwOnError
- Throws:
IOException
-
throwOnError
- Throws:
IOException
-
version
Returns the version string for this binary.- Returns:
- the version string.
- Throws:
IOException- If there is an error capturing output from the binary.
-
path
Returns the full path to the binary with arguments appended.- Parameters:
args- The arguments to pass to the binary.- Returns:
- The full path and arguments to execute the binary.
- Throws:
IOException- If there is an error capturing output from the binary
-