在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):0Adiber/MinecraftMovies开源软件地址(OpenSource Url):https://github.com/0Adiber/MinecraftMovies开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Minecraft MoviesThis is a Spigot Plugin, which lets you watch videos in vanilla Minecraft. This is done using Item Frames and some quick Maths. (actually the maths is kinda not quick). Note, that this is not usable for real life application, but rather as a proof of concept. It is also important to note, that this should not encourage anyone to watch or distribute pirated movies using Minecraft. How it worksThe process to display videos in the Client is kinda tedious, so read carefully.
PerformanceThis is a really interesting section, since we have a few problems regarding it:
RenderingRendering a video is really hard work for the computer. As much as I would have liked real time rendering (and displaying), it just does not work, because the function, which matches RGBA to MMC is on the lower end of the spectrum when talking about performance. I tried using a different algorithm (which also would not have made real time rendering possible), but this resulted in wrong colors, because there is a certain red shift we would need to calculate for the MMC. FilesBecause Real Time Rendering is not possible, I decided to save the files, since rendering is (as I mentioned several times) really hard work. This does not sound that bad, until you realize, the MMC types have a size of 1B. Now you have that for each Pixel. Meaning that if you have a video of 1920x1080, you would get >2Million Pixels => >2MB per Video Frame! If you now have a 1 minute Video with 20FPS and 1080p you would end up with almost 2,5GB. And then you also have 2B for the relative position. This relative position is only for each Item Frame though, so for a 1080p video you would end up with 120 Item Frames, each of those containing 128 Pixels. NetworkingAll those things above could be condoned, but THIS crushes everything. We know that each Item Frame contains 128x128 Pixels, and that each of those Pixels has a MMC, which has a size of 1B. This means, that each Item Frame has a size of over 16KB!! Since we have 120 Item Frames per Video Frame, we need to transmit ~2MB of Pixel Data. Since we want a Video and not a static image, we now need to do that 20 times a second, leading us to 40MB/s!!!! And this is only per Player. Meaning you would need a server with a good internet connection and then you need users, who all have at least 40MB/s of Download Speed. ConclusionThe Networking part really crushed this whole Project, but it is still possible on localhost. It is probably also possible in your local Network. Also important to mention is, that because of all those Packets, you will time out after some time. The Server handles it with no problems, but the Client somehow cannot send any Packets to the Server anymore. UsageTo use the Plugin you first of all either need to download it from the Releases or you clone the Repo and build it yourself. You will also need a Spigot-1.16.2 Server SetupPut the plugin in your plugins folder, reload the Server and then open Create a CanvasUse Render VideoTo render a video there are a few more steps needed.
Note that this process will take some time depending on the length of the video and make sure you have enough RAM allocated to the server. VerifyAfter the Render has finished you will get a notification in the console and in your Client. Before we can play a video, we need to do one last thing, which is verifying with Discord. This is done in two steps:
PlayingFinally we can play the Video. Before you do that, make sure you are in a Discord Channel on which the Bot is (if you don't, the video won't start). Now we simply execute And there you have the Marvel Intro from Captain America: The Winter Soldier. And it looks surprisingly good. (And the audio in discord is also clean) BuildBuilding the Plugin requires Maven. And the Spigot API as well as the Spigot Server file. Aquire Spigot files
Create .jarAll you need to do now is package the source code using maven. (I did this using IntelliJ). The command would be TODO
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论