Klasse 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.
  • Felddetails

  • Konstruktordetails

    • FFmpegUtils

      public FFmpegUtils()
  • Methodendetails

    • convertToOggFile

      @Deprecated public static void convertToOggFile(long requestId, File source, File target, AudioSettings settings, Consumer<ClientApi.UploadProgress> onProgressChanged, Consumer<File> onFinished, Consumer<de.mrjulsen.mcdragonlib.data.StatusResult> onError)
      Veraltet.
      Use convertToOggStream instead, as it doesn't use temp files.
      Converts the given audio file into an ogg vorbis audio file, which can be used by in Minecraft, using ffmpeg.
      Parameter:
      requestId - The id of the request. If unknown, use System.nanoTime().
      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.
      onFinished - This method will be called after converting the audio file. Pass null, if you don't want to use this.
      onError - This method will be called when an error occurs. Pass null, if you don't want to use this.
    • convertToOggStream

      public static void convertToOggStream(long requestId, InputStream audioInputData, AudioSettings settings, Consumer<InputStream> onFinished, Consumer<de.mrjulsen.mcdragonlib.data.StatusResult> onError, WritableInputStream outStream) throws IOException
      Converts the given audio file into an ogg vorbis audio file, which can be used by in Minecraft, using ffmpeg.
      Parameter:
      requestId - The id of the request. If unknown, use System.nanoTime().
      audioInputData - The input file data.
      settings - The settings for the output file.
      onFinished - This method will be called after converting the audio file. Pass null, if you don't want to use this.
      onError - This method will be called when an error occurs. Pass null, if you don't want to use this.
      Löst aus:
      IOException
    • 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.
      Parameter:
      file - The file you want to get the info from.
      Gibt zurück:
      A JAVE Multimedia Info object containing all information.
      Löst aus:
      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.
      Parameter:
      info - The MultimediaInfo Object
      key - The key of the metadata entry.
      Gibt zurück:
      A StatusResult object. The message() method will return the value (if available) or an empty string.