Fellow godot humans,

I'd appreciate a jumpstart into realtime video textures in godot. I stumbled upon the video player node and got a webm video working as animated texture on a plane, but I didn't manage to project a video onto a sphere. Could you help me find the respective pages in the documentation? Do you have any tips on video performance in godot (or the best practices when it comes to encoding/ decoding).

I want to project an equirechtengular 4k video as a prototype to a real life art installation with projectors on four walls. For video creation I use blender and ffmepg. So the prototype should run a 6 minute 360° video for head mounted displays.

I am new to godot, please keep your answers simple :)

kind regards, yarp

Hey @yarp! Welcome to the forums!

I'll try to answer the questions as best I can:

I'd appreciate a jumpstart into realtime video textures in godot. I stumbled upon the video player node and got a webm video working as animated texture on a plane, but I didn't manage to project a video onto a sphere. Could you help me find the respective pages in the documentation?

This tutorial shows you how to use a Viewport as a texture and put that on a sphere. Maybe it will help?

Projecting a flat image onto a sphere shouldn't be terribly hard, the hardest part is just finding which projection will make the image look like you want when wrapped around a sphere. Then you should in theory be able to play the video on a plane, have a viewport render it into a texture, and then set the viewport texture as the albedo of the material on the sphere.

Edit: Looking at the documentation, you might be able to skip the Viewport node and just use the get_video_texture function in the VideoPlayer node.

Here's a link to how to unwrap a sphere so the UV fits the texture.

Do you have any tips on video performance in godot (or the best practices when it comes to encoding/ decoding).

Personally I do not have any experience using the VideoPlayer node in Godot. That said. according to the documentation the VideoPlayer node can play videos in the WebM and OGV Theora formats.

I have no idea which is the better choice. If possible, I would convert the video you want to play to both formats and see which you like best and go from there.

According to this StackOverflow answer, it appears that WebM might be a tad more future proof thanks to Google, but I would say even that should be taken with a grain of salt.

Other things that might make a difference is the FPS, the bitrate of the video encoder/decoder, how much compression there is on the video, and more. I would definitely experiment to see what works best for your usecase!

I want to project an equirechtengular 4k video as a prototype to a real life art installation with projectors on four walls. For video creation I use blender and ffmepg. So the prototype should run a 6 minute 360° video for head mounted displays.

Sounds interesting. I'm not sure how well Godot handles 4k video, but so long as it can run the video at the correct frame rate, I think it should be easy-ish to get it projected around a sphere for head mounted displays.


I should add that I haven't really needed to project a video on a sphere myself, so most of what I wrote is based on experience with UV mapping, and a lot of speculation.

Regardless, I hope this helps!

5 days later

Sounds interesting. I'm not sure how well Godot handles 4k video, but so long as it can run the video at the correct frame rate, I think it should be easy-ish to get it projected around a sphere for head mounted displays.

As Godot can only use CPU-based decoding for videos, I highly doubt it's possible to decode 4K video smoothly, especially since VP9 is more expensive to decode compared to H.264.

Making use of the GPU capabilities sounds difficult for two reasons:

  • Godot uses the libtheora and libvpx libraries directly, without using middleware such as FFmpeg.
  • VP9 hardware decoding support remains uncommon in 2019 (on desktop platforms, only recent Intel IGPs on Windows 10 really support it).

It's technically possible to add support for FFmpeg and/or H.264, but licensing and patents make this undesirable as a first-party addition to Godot. Still, this may be achievable with a third-party module.

4 years later