Youtube in Minecraft at 20fps [WIP][Will be open source]

Discussion in 'Spigot Discussion' started by Dablakbandit, Jan 2, 2016.

  1. A while ago I watched a video on youtube by sk89q of him watching youtube in minecraft. In his version he would display the video on a single map 128 x 128 and the sound was external to minecraft.

    Having worked with maps a lot I decided that I would improve on his design, and so I created a complete youtube player with sound internal to minecraft. Due to limits the video size is 896x504 (which is 16:9) and the audio is done via a resourcepack.

    After doing the command the screen spawns above and in front of you, which is why in the video you see me move.

    Here is a video of my plugin displaying a video from youtube of sk89q playing videos on his map. Enjoy :)

    Updated Video with better colors:



    Note: This shows the video playing straight away cause I preloaded it. Normally would take several minutes for a 1 minute to be ready for playing.

    Please reply with any thoughts and questions :), I will be posting updates about this so stay tuned.

    Thanks,
    Dablakbandit


    sk89q's video(all credit to him for it):

    Update:
    Using my own custom map palette I am able to now more accurately show colors. Using dithering I am very accurately able to show colors. Also has a red bar across the top showing how far through the video it is.
    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
     
    #1 Dablakbandit, Jan 2, 2016
    Last edited: May 9, 2016
    • Like Like x 4
    • Creative Creative x 3
  2. o-o pretty crazy stuff xD
     
  3. Will this be open source?
     
  4. When it is in a fit state for open source haha, currently is a mess xD. But yes at some point this will be open source :)
     
  5. The biggest problem with this is that the map color palette in Minecraft sucks. It only has 140 colors. None of the colors are black!

    Do you use the colors palette in org.bukkit.map.MapPalette?
    https://hub.spigotmc.org/stash/proj.../src/main/java/org/bukkit/map/MapPalette.java
    These are the only colors that can be displayed on map items. Things would look a lot better if you could apply dithering to change the colors in the video to use the colors in the map color palette. I don't know if that would be too CPU-intensive.

    Be aware the map palette changed in 1.8.3, so be sure you use that or a later version for the client and server (the palettes have to match or it will look even uglier).
     
  6. I don't use the MapPalette exactly, I use an improved version that allows high speed retrieving of colors, which you will be able to see when I release the source. I am thinking of making a better version of the MapPalette as I don't think the colors are exactly accurate.
     
  7. This is really awesome. To bad maps don't display many colors. Imagine full HD tutorial videos when you first him a server.
     
    #8 Hailstorm, Jan 3, 2016
    Last edited: Jan 3, 2016
  8. Wow, this is truly amazing
     
  9. @Bobcat00
    Thanks to your suggestion I was able to get closer colors to the original image, but it still would not display properly. I have though created an even more advanced version that allows me to get even closer to the original image :) check the updated part of the original post
     
  10. You can only do so much with the map 140 color palette. (Even Netscape in 1994 had 216 colors.) Did you try dithering? It might be too CPU-intensive.

    EDIT: Here are some still images displayed in-game as maps on my server. The image on the left shows how dithering can improve things (compared to the image on the right).
    http://www.bobcat00.com/palette_example.png
     
    #13 Bobcat00, Jan 3, 2016
    Last edited: Jan 3, 2016
  11. What do you use to dither?
     
  12. I just used an option in my graphics editing program. When loading a new palette, the options are to use the nearest color for each pixel or to do dithering.

    You'd have to find a dithering algorithm or implement your own. Again, I don't know if it's practical for video.
     
  13. omg! This is amazing! 10/10! :eek:
     
  14. I found a way to implement dithering, and I must say the colors show much up better, thanks for the suggestion. Added a sample image to the main post :)
     
  15. TRIPPY BRO. THE MAP VIDEO WITHIN THE MAP VIDEO IS FAR OUT MAN.
     
  16. Youtube in Minecraft... what´s the next?:)

    Yours,
    Lordbonr1