Class FFmpegUtils
java.lang.Object
de.mrjulsen.dragnsounds.core.ffmpeg.FFmpegUtils
A collection of some simple tools to work with ffmpeg.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static ws.schild.jave.info.MultimediaInfo
Get information about the given audio file.static de.mrjulsen.mcdragonlib.data.StatusResult
getMetadataSafe
(ws.schild.jave.info.MultimediaInfo info, String key) A safe way to get metadata.
-
Field Details
-
VORBIS_CODEC
- See Also:
-
-
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. Passnull
, 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 Objectkey
- The key of the metadata entry.- Returns:
- A
StatusResult
object. Themessage()
method will return the value (if available) or an empty string.
-