Klasse FFmpegUtils
java.lang.Object
de.mrjulsen.dragnsounds.core.ffmpeg.FFmpegUtils
A collection of some simple tools to work with ffmpeg.
-
Feldübersicht
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic 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.static void
convertToOggStream
(long requestId, InputStream audioInputData, AudioSettings settings, Consumer<InputStream> onFinished, Consumer<de.mrjulsen.mcdragonlib.data.StatusResult> onError, WritableInputStream outStream) Converts the given audio file into an ogg vorbis audio file, which can be used 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.
-
Felddetails
-
VORBIS_CODEC
- Siehe auch:
-
OGG
- Siehe auch:
-
-
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.UseconvertToOggStream
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, useSystem.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. Passnull
, if you don't want to use this.onFinished
- This method will be called after converting the audio file. Passnull
, if you don't want to use this.onError
- This method will be called when an error occurs. Passnull
, 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, useSystem.nanoTime()
.audioInputData
- The input file data.settings
- The settings for the output file.onFinished
- This method will be called after converting the audio file. Passnull
, if you don't want to use this.onError
- This method will be called when an error occurs. Passnull
, 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 Objectkey
- The key of the metadata entry.- Gibt zurück:
- A
StatusResult
object. Themessage()
method will return the value (if available) or an empty string.
-
convertToOggStream
instead, as it doesn't use temp files.