Package ws.schild.jave.process.ffmpeg
Class DefaultFFMPEGLocator
- java.lang.Object
-
- ws.schild.jave.process.ffmpeg.DefaultFFMPEGLocator
-
- All Implemented Interfaces:
ProcessLocator
public class DefaultFFMPEGLocator extends java.lang.Object implements ProcessLocator
The default ffmpeg executable locator, which exports on disk the ffmpeg executable bundled with the library distributions. It should work both for windows and many linux distributions. If it doesn't, try compiling your own ffmpeg executable and plug it in JAVE with a customFFMPEGProcess
-
-
Constructor Summary
Constructors Constructor Description DefaultFFMPEGLocator()It builds the default FFMPEGLocator, exporting the ffmpeg executable on a temp file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancopy(java.io.InputStream source, java.lang.String destination)Copy a file from source to destination.private voidcopyFile(java.lang.String path, java.io.File dest)Copies a file bundled in the package to the supplied destination.ProcessWrappercreateExecutor()It returns a brand newProcessWrapper, ready to be used in a ffmpeg call.java.lang.StringgetExecutablePath()This method should return the path of a ffmpeg executable suitable for the current machine.
-
-
-
Method Detail
-
getExecutablePath
public java.lang.String getExecutablePath()
Description copied from interface:ProcessLocatorThis method should return the path of a ffmpeg executable suitable for the current machine.- Specified by:
getExecutablePathin interfaceProcessLocator- Returns:
- The path of the ffmpeg executable.
-
copyFile
private void copyFile(java.lang.String path, java.io.File dest)Copies a file bundled in the package to the supplied destination.- Parameters:
path- The name of the bundled file.dest- The destination.- Throws:
java.lang.RuntimeException- If an unexpected error occurs.
-
copy
private boolean copy(java.io.InputStream source, java.lang.String destination)Copy a file from source to destination.- Parameters:
source- The name of the bundled file.destination- the destination- Returns:
- True if succeeded , False if not
-
createExecutor
public ProcessWrapper createExecutor()
Description copied from interface:ProcessLocatorIt returns a brand newProcessWrapper, ready to be used in a ffmpeg call.- Specified by:
createExecutorin interfaceProcessLocator- Returns:
- A newly instanced
ProcessWrapper, using this locator to call the ffmpeg executable.
-
-