Class DefaultFFMPEGLocator

java.lang.Object
ws.schild.jave.process.ffmpeg.DefaultFFMPEGLocator
All Implemented Interfaces:
ProcessLocator

public class DefaultFFMPEGLocator extends 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 custom FFMPEGProcess
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • path

      private final String path
      The ffmpeg executable file path.
  • Constructor Details

    • DefaultFFMPEGLocator

      public DefaultFFMPEGLocator()
      It builds the default FFMPEGLocator, exporting the ffmpeg executable on a temp file.
  • Method Details

    • getExecutablePath

      public String getExecutablePath()
      Description copied from interface: ProcessLocator
      This method should return the path of a ffmpeg executable suitable for the current machine.
      Specified by:
      getExecutablePath in interface ProcessLocator
      Returns:
      The path of the ffmpeg executable.
    • copyFile

      private void copyFile(String path, 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:
      RuntimeException - If an unexpected error occurs.
    • copy

      private boolean copy(InputStream source, 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: ProcessLocator
      It returns a brand new ProcessWrapper, ready to be used in a ffmpeg call.
      Specified by:
      createExecutor in interface ProcessLocator
      Returns:
      A newly instanced ProcessWrapper, using this locator to call the ffmpeg executable.