Package net.bramp.ffmpeg
Class FFprobe
- java.lang.Object
-
- net.bramp.ffmpeg.FFprobe
-
-
Constructor Summary
Constructors Constructor Description FFprobe()FFprobe(String path)FFprobe(String path, ProcessFunction runFunction)FFprobe(ProcessFunction runFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetPath()booleanisFFprobe()Returns true if the binary we are using is the true ffprobe.List<String>path(List<String> args)Returns the full path to the binary with arguments appended.FFmpegProbeResultprobe(String mediaPath)FFmpegProbeResultprobe(String mediaPath, String userAgent)voidrun(List<String> args)Runs the binary (ffmpeg) with the supplied args.protected voidthrowOnError(Process p)Stringversion()Returns the version string for this binary.protected BufferedReaderwrapInReader(Process p)
-
-
-
Constructor Detail
-
FFprobe
public FFprobe() throws IOException
- Throws:
IOException
-
FFprobe
public FFprobe(@Nonnull ProcessFunction runFunction) throws IOException
- Throws:
IOException
-
FFprobe
public FFprobe(@Nonnull String path) throws IOException
- Throws:
IOException
-
FFprobe
public FFprobe(@Nonnull String path, @Nonnull ProcessFunction runFunction)
-
-
Method Detail
-
probe
public FFmpegProbeResult probe(String mediaPath) throws IOException
- Throws:
IOException
-
isFFprobe
public boolean isFFprobe() throws IOException
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
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.
-
probe
public FFmpegProbeResult probe(String mediaPath, @Nullable String userAgent) throws IOException
- Throws:
IOException
-
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.
-
getPath
public String getPath()
-
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
-
-