How darksavci/minecraft-video-player works
Project Type and Purpose
• This is a server-side Minecraft plugin (for Paper/Spigot 1.19.4) written in Java using Maven.
File Structure
• src/main/java/dev/bdinc/minecraft_video_player: all Java source.
– Main.java: plugin entry point, registers commands.
– *Command.java classes: handle /processvideo, /processimage, /processstream, /setres, /undo.
– VideoFrameProcessor.java & StreamFrameProcessor.java: abstract the mechanics of reading and iterating through frames.
• src/main/resources/plugin.yml: plugin descriptor used by the server to detect commands, permissions, and plugin metadata.
• pom.xml: declares JavaCV (ffmpeg-based) dependencies and build targets.
Extract Key Insights from the README
• Uses JavaCPP/JavaCV presets to decode video/stream on a separate thread.
• Supports dynamic FPS changes and configurable resolution via commands.
• Deploys as a .jar inside a plugins directory on a Paper/Spigot server.
Main Components
a. Minecraft Server (Paper/Spigot)
b. Plugin Loader (Bukkit API)
c. Plugin Core
– Command Handlers
– Processing Engine
d. External Dependencies
– JavaCV/FFmpeg native libraries
e. Data Stores/Config
– plugin.yml (static metadata)
– (Future) config file for max FPS/resolution
Relationships & Data Flow
1) Player issues a chat command → 2) Bukkit calls the corresponding Command class → 3) Command starts or configures a Processing Thread → 4) Processing Engine uses JavaCV to fetch and decode frames → 5) For each frame:
• ColorManager maps pixels → Minecraft Block data
• Plugin invokes Bukkit World API to place/update blocks → rendering in-game
6) /undo rolls back placed blocks.
Architectural Patterns & Design Principles
• Separation of Concerns:
– Command Layer (Bukkit command interface)
– Processing Layer (frame decoding & iteration)
– Mapping Layer (pixel→block)
– Rendering Layer (world updates)
• Concurrency: video/stream processing offloaded to dedicated threads to avoid blocking the server main thread.
Relevant Technologies/Frameworks
• Java 17+ (or Java 11)
• Maven build lifecycle (pom.xml)
• Bukkit/Paper API
• JavaCPP/JavaCV (FFmpeg) native bindings