Giter VIP home page Giter VIP logo

ezmediacore's Introduction

Build Status Code Coverage Dependency Status Documentation Status Discord Language

EzMediaCore


EzMediaCore is a library written in Java using the Spigot API and NMS classes to provide a helpful tool for other media plugins to take advantage of. One of the most fascinating features include the ability to render videos on a Spigot server.

In order to maintain fast processing speeds, algorithms such as dithering, hardware acceleration, and use of native code is utilized. The library primarily uses VLC Media Player and FFmpeg, for blazing fast frame delivery and support for many sorts of media formats (including streams).

example-playback.mp4

Frame rates can reach up to the 30's or 40's with extremely great quality. As a comparison, a smooth animation is approximately 25 frames. The library is capable of playing media in many sorts of ways, such as maps, entities, chat, scoreboards, debug markers. It is also capable of providing audio through a resourcepack, website, and Discord bot (primarily for playing streams).


Prerequisites

  • Java 17
  • Minecraft versions 1.18.2 and 1.19 supported.

Add the following to your gradle configuration:

repositories {  
    maven("https://pulsebeat02.jfrog.io/artifactory/minecraftmedialibrary/")
}  
dependencies {  
    implementation("io.github.pulsebeat02:EzMediaCore:v1.0.0")
}  

Take a look at this module for examples on how to use the library. It is the plugin I used that displayed the video.


Building Locally

  1. Run BuildTools for versions 1.18.2 and 1.19.
  2. Clone the repository by using the following Git link: https://github.com/MinecraftMediaLibrary/EzMediaCore.git
  3. Run gradlew shadowJar on the parent project to build a jar for the plugin.

Partnerships

BisectHosting

I'd like to also thank BisectHosting for sponsoring open-source projects such as this one as well. Use code pulse on your next purchase to get 25% off your next server!


Contributors / Acknowledgements

Developer Contribution
BananaPuncher714 Created the original MinecraftVideo plugin
Jetp250 Developed Floyd Steinberg dithering
Emilyy Assisted with implementation and testing
Conclure Assisted with Maven to Gradle migration
itxfrosty Developed a Discord bot for music integration
Rouge_Ram Developed a Discord bot used in Pulse Development!
Sponsor Donation
Vijay Pondini $10.00
Matthew Holden $6.00
Project / Dependency Contribution
VLCJ made by caprica VLC Media Player Bindings
VLC Media Player Native Backend Support
Jaffree made by kokorin FFmpeg Integration (NUT Container)
FFmpeg Native Media Encoding and Decoding

Projects that use EzMediaCore Code

Project Description
MakiDesktop Controlling VNC through Minecraft Maps
MakiScreen Streaming OBS onto Minecraft Maps

ezmediacore's People

Contributors

conclube avatar emilyy-dev avatar itxfrosty avatar pulsebeat02 avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ezmediacore's Issues

Extremely Outdated Docs & Example Plugin

Howdy. I'm trying to use this library in my plugin, but the docs are extraordinarily outdated, and even the example plugin - DeluxeMediaPlugin - makes use of classes and methods that have been renamed or even removed entirely.

I appreciate the work you're doing, and I'm very impressed with how far it has come, but it's nearly impossible to use this without spending days or weeks trying to read through this big of a project and figure out how it all works, since the docs and example are so outdated.

Task List

Task List:

too lazy to update tasks on Github. To do list can be found in Discord.

Propose New Algorithm for Video Player

Suppose we had two separate threads:

Thread #1: Dithers a specific frame.
Thread #2: Sends the dithered frame data to the clients.

Frame # | What to do:
--------|-------------------------------------
   1    | Thread #1 dithers this frame.
   2    | Thread #2 sends out frame number 1, while Thread #1 dithers frame number 2.
   3    | Thread #2 sends out frame number 2, while Thread #1 dithers frame number 3.
        |

And so on, (chaining domino pattern)

------------------------------------------------------------------------------------------------------

The issue however with one thread is blocking. If the dithered results aren't ready, this means that thread #2 has to be blocked from thread #1 to wait for the send the dithered results to clients. This will significantly slow the video speed and affect the frames being sent per second.

------------------------------------------------------------------------------------------------------

We could split this into more threads based on the user's environment. For example:

Thread #1 ... #2: Dithers a specific frame. (We can dither 2 frames at once since we have 2 threads now instead of just 1)
Thread #3: Sends the dithered frame data to the clients.

Frame # | What to do:
--------|-------------------------------------
   1    | Thread #1 and #2 dithers this frame at the same time.
   2    | Thread #3 sends the dithered frame provided from thread #1/#2. Thread #1/#2 now dithers frame 2. 
        | 

And so on, (chaining domino pattern)

The advantage of having two threads dither is that the result may be faster to receive due to the parallel computations made on the frame dithering. This will mean that the chance of blocking will likely less occur due to how in an ideal environment (where it can support multiple threads running at once at a good pace), it can provide the results faster.

  • Since the actual dithering process will be made async/in parallel, encapsulate the result in a Future<int[]>

  • Have a FrameSender class (or whatever you wanna call it) with a Queue<Future<int[]>>, I believe a LinkedList is the best option here

  • Add the future data to the FrameSender queue orderly before/when the dithering starts (not after it finishes, kinda defeats the purpose of using Futures here), then start the process in parallel. That way, no matter when the frame is processed, since you put them in order as they come in, they will be in order when you retrieve them

  • In the sender, so long so it isn't empty, remove() the frame and Futures.getUnchecked(frame) the data and send it, that way it will be sent as soon as it's done (basically blocking the sender thread before sending it until the frame is processed; hopefully, them being processed in parallel will keep them up and overcome any waiting overhead) (the class is from Guava, it just wraps the checked Future#get() exceptions in an unchecked exception/error)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Package lookup failures

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update cimg/openjdk Docker tag to v17.0.9
  • Update dependency gradle to v7.6.3
  • Update dependency it.unimi.dsi:fastutil to v8.5.12
  • Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.2
  • Update plugin com.github.johnrengelman.shadow to v7.1.2
  • Update dependency com.fasterxml.jackson.core:jackson-core to v2.16.0
  • Update dependency net.kyori:adventure-api to v4.14.0
  • Update dependency net.kyori:adventure-platform-bukkit to v4.3.1
  • Update dependency org.jetbrains:annotations to v24.1.0
  • Update plugin org.ajoberstar.grgit to v5.2.1
  • Update cimg/openjdk Docker tag to v21
  • Update dependency com.github.kokorin.jaffree:jaffree to v2023
  • Update dependency com.google.guava:guava to v32
  • Update dependency me.friwi:jcefmaven to v116
  • Update plugin com.github.johnrengelman.shadow to v8
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Warning

Renovate failed to look up the following dependencies: Failed to look up maven package org.spigotmc:spigot-api, Failed to look up maven package com.mojang:authlib, Failed to look up maven package com.mojang:brigadier, Failed to look up maven package com.github.sealedtx:java-youtube-downloader, Failed to look up maven package org.spigotmc:spigot.

Files affected: deluxemediaplugin/build.gradle.kts, deluxewebdisplays/build.gradle.kts, ezmediacore/api/build.gradle.kts, ezmediacore/main/build.gradle.kts, ezmediacore/v1_18_R2/build.gradle.kts, ezmediacore/v1_19_R1/build.gradle.kts, ezmediacore/v1_19_R2/build.gradle.kts


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • cimg/openjdk 17.0.6
gradle
settings.gradle.kts
build.gradle.kts
  • com.github.hierynomus.license-base 0.16.1
  • org.ajoberstar.grgit 5.0.0
  • org.jetbrains:annotations 24.0.0
deluxemediaplugin/build.gradle.kts
  • com.github.johnrengelman.shadow 7.1.2
  • xyz.jpenilla.run-paper 2.0.0
  • org.spigotmc:spigot-api 1.18.2-R0.1-SNAPSHOT
  • com.mojang:authlib 1.5.26
  • net.dv8tion:JDA 5.0.0-beta.3
  • org.bstats:bstats-bukkit 3.0.0
  • net.kyori:adventure-api 4.12.0
  • net.kyori:adventure-platform-bukkit 4.2.0
  • com.github.stefvanschie.inventoryframework:IF 0.10.8
  • com.mojang:brigadier 1.0.18
  • me.lucko:commodore 2.2
deluxewebdisplays/build.gradle.kts
  • com.github.johnrengelman.shadow 7.1.2
  • org.spigotmc:spigot-api 1.18.2-R0.1-SNAPSHOT
  • me.friwi:jcefmaven 109.1.11
  • org.bstats:bstats-bukkit 3.0.0
  • net.kyori:adventure-api 4.12.0
  • net.kyori:adventure-platform-bukkit 4.2.0
  • com.mojang:brigadier 1.0.18
  • me.lucko:commodore 2.2
ezmediacore/api/build.gradle.kts
  • org.spigotmc:spigot-api 1.18.2-R0.1-SNAPSHOT
ezmediacore/lib/build.gradle.kts
  • com.github.johnrengelman.shadow 7.1.1
ezmediacore/main/build.gradle.kts
  • com.github.johnrengelman.shadow 7.1.2
  • org.spigotmc:spigot-api 1.18.2-R0.1-SNAPSHOT
  • me.friwi:jcefmaven 109.1.11.1
  • io.netty:netty-all 4.1.87.Final
  • com.mojang:authlib 3.16.29
  • com.google.guava:guava 31.1-jre
  • com.mpatric:mp3agic 0.9.1
  • com.github.kevinsawicki:http-request 6.0
  • uk.co.caprica:vlcj 4.8.2
  • uk.co.caprica:vlcj-natives 4.8.1
  • com.github.sealedtx:java-youtube-downloader 3.0.2
  • com.alibaba:fastjson 2.0.23
  • net.java.dev.jna:jna 5.13.0
  • net.java.dev.jna:jna-platform 5.13.0
  • se.michaelthelin.spotify:spotify-web-api-java 7.3.0
  • com.github.kokorin.jaffree:jaffree 2022.06.03
  • org.jcodec:jcodec 0.2.5
  • com.github.ben-manes.caffeine:caffeine 3.1.2
  • it.unimi.dsi:fastutil 8.5.11
  • com.fasterxml.jackson.core:jackson-core 2.14.2
  • org.apache.httpcomponents.client5:httpclient5 5.2.1
  • com.neovisionaries:nv-i18n 1.29
ezmediacore/v1_18_R2/build.gradle.kts
  • org.spigotmc:spigot 1.18.2-R0.1-SNAPSHOT
ezmediacore/v1_19_R1/build.gradle.kts
  • org.spigotmc:spigot 1.19.2-R0.1-SNAPSHOT
ezmediacore/v1_19_R2/build.gradle.kts
  • org.spigotmc:spigot 1.19.3-R0.1-SNAPSHOT
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 7.6

  • Check this box to trigger a request for Renovate to run again on this repository

BIG REWRITE

Rewriting a ton of stuff. Please don't use the library currently as a big rewrite is in place.

Documentation

  • Video Players
  • Audio Playback
  • Images (both static and dynamic)
  • Youtube/Spotify Playlists
  • Using the Web Interface
  • Dependency Loading Information

Linux Support

Linux support is currently in progress. I am using JuNest to try and install the packages. Here is my progress so far:

  • Install JuNest by using a zip file. (Completed: https://github.com/PulseBeat02/JuNest-Mirror).
  • Run a bash script that changes the export paths of JuNest to be proper (so future bash scripts can be executed).
  • Run a bash script that installs the proper VLC package downloaded previously.
  • Set the proper paths in NativeDiscovery to the JuNest directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.