public class ProcessWrapper extends Object implements AutoCloseable
| Constructor and Description |
|---|
ProcessWrapper(String ffmpegExecutablePath)
It build the executor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArgument(String arg)
Adds an argument to the ffmpeg executable call.
|
void |
close() |
void |
destroy()
If there's a ffmpeg execution in progress, it kills it.
|
protected Stream<String> |
enhanceArguments(Stream<String> execArgs)
Provide an opportunity for subclasses to enhance the argument list before passing off to
execute.
|
void |
execute()
Executes the ffmpeg process with the previous given arguments.
|
void |
execute(boolean destroyOnRuntimeShutdown,
boolean openIOStreams)
Executes the ffmpeg process with the previous given arguments.
|
InputStream |
getErrorStream()
Returns a stream reading from the ffmpeg process standard error channel.
|
InputStream |
getInputStream()
Returns a stream reading from the ffmpeg process standard output channel.
|
OutputStream |
getOutputStream()
Returns a stream writing in the ffmpeg process standard input channel.
|
int |
getProcessExitCode()
Return the exit code of the ffmpeg process If the process is not yet terminated, it waits for
the termination of the process
|
public ProcessWrapper(String ffmpegExecutablePath)
ffmpegExecutablePath - The path of the ffmpeg executable.public void addArgument(String arg)
arg - The argument.public void execute(boolean destroyOnRuntimeShutdown,
boolean openIOStreams)
throws IOException
destroyOnRuntimeShutdown - destroy process if the runtime VM is shutdownopenIOStreams - Open IO streams for input/output and errorout, should be false when
destroyOnRuntimeShutdown is false tooIOException - If the process call fails.protected Stream<String> enhanceArguments(Stream<String> execArgs)
execArgs - The current Stream of argumentspublic void execute()
throws IOException
IOException - If the process call fails.public InputStream getInputStream()
public OutputStream getOutputStream()
public InputStream getErrorStream()
public void destroy()
public int getProcessExitCode()
public void close()
close in interface AutoCloseableCopyright © 2020. All rights reserved.