Class 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 custom FFMPEGProcess
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger LOG  
      private java.lang.String path
      The ffmpeg executable file path.
    • 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 boolean copy​(java.io.InputStream source, java.lang.String destination)
      Copy a file from source to destination.
      private void copyFile​(java.lang.String path, java.io.File dest)
      Copies a file bundled in the package to the supplied destination.
      ProcessWrapper createExecutor()
      It returns a brand new ProcessWrapper, ready to be used in a ffmpeg call.
      java.lang.String getExecutablePath()
      This method should return the path of a ffmpeg executable suitable for the current machine.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • path

        private final java.lang.String path
        The ffmpeg executable file path.
    • Constructor Detail

      • DefaultFFMPEGLocator

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

      • getExecutablePath

        public java.lang.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​(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