Package net.bramp.ffmpeg
Class FFmpeg
- java.lang.Object
-
- net.bramp.ffmpeg.FFmpeg
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUDIO_DEPTH_DBLDeprecated.static StringAUDIO_DEPTH_FLTDeprecated.static StringAUDIO_DEPTH_S16Deprecated.static StringAUDIO_DEPTH_S32Deprecated.static StringAUDIO_DEPTH_U8Deprecated.static StringAUDIO_FORMAT_DBLstatic StringAUDIO_FORMAT_FLTstatic StringAUDIO_FORMAT_S16static StringAUDIO_FORMAT_S32static StringAUDIO_FORMAT_U8static intAUDIO_MONOstatic intAUDIO_SAMPLE_11025static intAUDIO_SAMPLE_12000static intAUDIO_SAMPLE_16000static intAUDIO_SAMPLE_22050static intAUDIO_SAMPLE_32000static intAUDIO_SAMPLE_44100static intAUDIO_SAMPLE_48000static intAUDIO_SAMPLE_8000static intAUDIO_SAMPLE_96000static intAUDIO_STEREOstatic StringDEFAULT_PATHstatic StringFFMPEGstatic FractionFPS_23_976static FractionFPS_24static FractionFPS_29_97static FractionFPS_30
-
Constructor Summary
Constructors Constructor Description FFmpeg()FFmpeg(String path)FFmpeg(String path, ProcessFunction runFunction)FFmpeg(ProcessFunction runFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FFmpegBuilderbuilder()List<Codec>codecs()protected ProgressParsercreateProgressParser(ProgressListener listener)List<Format>formats()StringgetPath()booleanisFFmpeg()Returns true if the binary we are using is the true ffmpeg.List<String>path(List<String> args)Returns the full path to the binary with arguments appended.voidrun(List<String> args)Runs the binary (ffmpeg) with the supplied args.voidrun(FFmpegBuilder builder)voidrun(FFmpegBuilder builder, ProgressListener listener)protected voidthrowOnError(Process p)Stringversion()Returns the version string for this binary.protected BufferedReaderwrapInReader(Process p)
-
-
-
Field Detail
-
FFMPEG
public static final String FFMPEG
- See Also:
- Constant Field Values
-
DEFAULT_PATH
public static final String DEFAULT_PATH
-
FPS_23_976
public static final Fraction FPS_23_976
-
AUDIO_MONO
public static final int AUDIO_MONO
- See Also:
- Constant Field Values
-
AUDIO_STEREO
public static final int AUDIO_STEREO
- See Also:
- Constant Field Values
-
AUDIO_FORMAT_U8
public static final String AUDIO_FORMAT_U8
- See Also:
- Constant Field Values
-
AUDIO_FORMAT_S16
public static final String AUDIO_FORMAT_S16
- See Also:
- Constant Field Values
-
AUDIO_FORMAT_S32
public static final String AUDIO_FORMAT_S32
- See Also:
- Constant Field Values
-
AUDIO_FORMAT_FLT
public static final String AUDIO_FORMAT_FLT
- See Also:
- Constant Field Values
-
AUDIO_FORMAT_DBL
public static final String AUDIO_FORMAT_DBL
- See Also:
- Constant Field Values
-
AUDIO_DEPTH_U8
@Deprecated public static final String AUDIO_DEPTH_U8
Deprecated.- See Also:
- Constant Field Values
-
AUDIO_DEPTH_S16
@Deprecated public static final String AUDIO_DEPTH_S16
Deprecated.- See Also:
- Constant Field Values
-
AUDIO_DEPTH_S32
@Deprecated public static final String AUDIO_DEPTH_S32
Deprecated.- See Also:
- Constant Field Values
-
AUDIO_DEPTH_FLT
@Deprecated public static final String AUDIO_DEPTH_FLT
Deprecated.- See Also:
- Constant Field Values
-
AUDIO_DEPTH_DBL
@Deprecated public static final String AUDIO_DEPTH_DBL
Deprecated.- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_8000
public static final int AUDIO_SAMPLE_8000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_11025
public static final int AUDIO_SAMPLE_11025
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_12000
public static final int AUDIO_SAMPLE_12000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_16000
public static final int AUDIO_SAMPLE_16000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_22050
public static final int AUDIO_SAMPLE_22050
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_32000
public static final int AUDIO_SAMPLE_32000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_44100
public static final int AUDIO_SAMPLE_44100
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_48000
public static final int AUDIO_SAMPLE_48000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_96000
public static final int AUDIO_SAMPLE_96000
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FFmpeg
public FFmpeg() throws IOException
- Throws:
IOException
-
FFmpeg
public FFmpeg(@Nonnull ProcessFunction runFunction) throws IOException
- Throws:
IOException
-
FFmpeg
public FFmpeg(@Nonnull String path) throws IOException
- Throws:
IOException
-
FFmpeg
public FFmpeg(@Nonnull String path, @Nonnull ProcessFunction runFunction) throws IOException
- Throws:
IOException
-
-
Method Detail
-
isFFmpeg
public boolean isFFmpeg() throws IOException
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
@Nonnull public List<Codec> codecs() throws IOException
- Throws:
IOException
-
formats
@Nonnull public List<Format> formats() throws IOException
- Throws:
IOException
-
createProgressParser
protected ProgressParser createProgressParser(ProgressListener listener) throws IOException
- Throws:
IOException
-
run
public void run(List<String> args) throws IOException
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
public void run(FFmpegBuilder builder) throws IOException
- Throws:
IOException
-
run
public void run(FFmpegBuilder builder, @Nullable ProgressListener listener) throws IOException
- Throws:
IOException
-
builder
@CheckReturnValue public FFmpegBuilder builder()
-
wrapInReader
protected BufferedReader wrapInReader(Process p)
-
throwOnError
protected void throwOnError(Process p) throws IOException
- Throws:
IOException
-
version
@Nonnull public String version() throws IOException
Returns the version string for this binary.- Returns:
- the version string.
- Throws:
IOException- If there is an error capturing output from the binary.
-
path
public List<String> path(List<String> args) throws IOException
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
-
-