MediaPlayer

Mod

A decode library for Minecraft based on ffmpeg.

Client and server Library

967 downloads
1 follower
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!

MediaPlayer

A decode library for Minecraft based on ffmpeg.

Features:

  • Video and audio decoder
  • Hardware acceleration
  • Supports many media formats
  • Only Windows x64 platform is supported

How to use:

For user

Use the commands

/summon mediaplayer:video
/mediaplayer video

to play video.

Or use

/mediaplayer audio

to play audio.

Use

/mediaplayer clear

stop all video and audio.

For developer

Create decoder

var file = new File("<video file path>");
var decoder = VideoDecoder.create(file);

Decode and render frame

decoder.fetch();
bufferSource.getBuffer(VideoRenderType.create(decoder.frame));
/* Rendering code */

Play companion audio from video

Minecraft.getInstance().getSoundManager().play(new AudioInstance(decoder.audio.decode(false), null));

Play independent audio

Minecraft.getInstance().getSoundManager().play(new AudioInstance(new AudioDecoder.decode(false), null));

Project members

hackermdch

Member

Details

Licensed LGPL-3.0-only
Published 4 months ago
Updated 4 months ago