Class FFmpegUtils

java.lang.Object
de.mrjulsen.dragnsounds.core.ffmpeg.FFmpegUtils

public final class FFmpegUtils extends Object
A collection of some simple tools to work with ffmpeg.
  • Field Details

  • Constructor Details

    • FFmpegUtils

      public FFmpegUtils()
  • Method Details

    • convertToOgg

      public static void convertToOgg(long requestId, File source, File target, AudioSettings settings, Consumer<ClientApi.UploadProgress> onProgressChanged, Consumer<File> onFinished, Consumer<de.mrjulsen.mcdragonlib.data.StatusResult> onError)
      Converts the given audio file into an ogg vorbis audio file, which can be by in Minecraft, using ffmpeg.
      Parameters:
      source - The input file.
      target - The output file.
      settings - The settings for the output file.
      onProgressChanged - This method will be called while converting and reports the progress. Pass null, if you don't want to use this.
    • getInfo

      public static ws.schild.jave.info.MultimediaInfo getInfo(File file) throws ws.schild.jave.InputFormatException, ws.schild.jave.EncoderException
      Get information about the given audio file.
      Parameters:
      file - The file you want to get the info from.
      Returns:
      A JAVE Multimedia Info object containing all information.
      Throws:
      ws.schild.jave.InputFormatException
      ws.schild.jave.EncoderException
    • getMetadataSafe

      public static de.mrjulsen.mcdragonlib.data.StatusResult getMetadataSafe(ws.schild.jave.info.MultimediaInfo info, String key)
      A safe way to get metadata. This method returns the data for the specified key, if available. Otherwiese it will return an empty string.
      Parameters:
      info - The MultimediaInfo Object
      key - The key of the metadata entry.
      Returns:
      A StatusResult object. The message() method will return the value (if available) or an empty string.