Package net.bramp.ffmpeg
Class FFprobe
java.lang.Object
net.bramp.ffmpeg.FFprobe
Wrapper around FFprobe.
- Author:
- bramp
-
Constructor Summary
ConstructorsConstructorDescriptionFFprobe()Constructs an FFprobe instance using the default path.Constructs an FFprobe instance using the specified path.FFprobe(String path, ProcessFunction runFunction) Constructs an FFprobe instance using the specified path and process function.FFprobe(ProcessFunction runFunction) Constructs an FFprobe instance using the default path and the specified process function. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a new FFprobeBuilder instance.getPath()booleanReturns true if the binary we are using is the true ffprobe.Returns the full path to the binary with arguments appended.Probes the specified media file and returns the result.Probes the specified media file with an optional user agent.Probes media with an optional user agent and extra arguments.Probes media using the supplied arguments and returns the result.probe(FFprobeBuilder builder) Probes media using the supplied FFprobeBuilder.voidRuns the binary (ffmpeg) with the supplied args.voidsetProcessErrorStream(Appendable processErrorStream) voidsetProcessOutputStream(Appendable processOutputStream) protected voidprotected voidthrowOnError(Process p, FFmpegProbeResult result) version()Returns the version string for this binary.protected BufferedReaderprotected BufferedReader
-
Constructor Details
-
FFprobe
Constructs an FFprobe instance using the default path.- Throws:
IOException
-
FFprobe
Constructs an FFprobe instance using the default path and the specified process function.- Throws:
IOException
-
FFprobe
Constructs an FFprobe instance using the specified path.- Throws:
IOException
-
FFprobe
Constructs an FFprobe instance using the specified path and process function.
-
-
Method Details
-
probe
Probes the specified media file and returns the result.- Throws:
IOException
-
probe
Probes the specified media file with an optional user agent.- Throws:
IOException
-
probe
Probes media using the supplied FFprobeBuilder.- Throws:
IOException
-
probe
public FFmpegProbeResult probe(String mediaPath, @Nullable String userAgent, @Nullable String... extraArgs) throws IOException Probes media with an optional user agent and extra arguments.- Throws:
IOException
-
probe
Probes media using the supplied arguments and returns the result.- Throws:
IOException
-
isFFprobe
Returns true if the binary we are using is the true ffprobe. This is to avoid conflict with avprobe (from the libav project), that some symlink to ffprobe.- Returns:
- true iff this is the official ffprobe binary.
- Throws:
IOException- If a I/O error occurs while executing ffprobe.
-
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.
-
builder
Returns a new FFprobeBuilder instance. -
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.
-
getPath
-
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
-