Reading a video at a specific frame (in Godot 2)?

MinaMahelMinaMahel Posts: 1Member

Hello, I am new to Godot and I have a question on image sequences and videos.

I am currently struggling with a work issue on a Godot project. The topic is showing the evolution of Earth through the last 500 million years, frame by frame, with about 2.5 million years between each. The user can use a timeline to travel through time, i.e. to switch between all the images. The final result should run on a large screen and a computer that does not have a lot of memory.

So I need to display a long sequence of high-resolution images (a little more than 300 images, that are 3600x1800 pixels wide). I thought using the Godot VideoPlayer would solve the problem... the issue is that I also need to jump to a specific frame directly, to be able to go anywhere in my timeline!

So far, I have downloaded the Github sources of Godot 2.1.3. and tried to modify the video_stream_theora.cpp file, by adding a seek_frame function that allows me to go to one frame of my video in particular. However my implementation relies on:
- storing all the already-looked-at frames in a large buffer
- if the requested frame is in the past of the video, look at the buffer and get back the image
- if it is in the future of the video, perform the same thing as the update function until you reach it
... and this requires way too much memory for it to be okay! The buffer crashes when I put in my high-res images.

I was wondering if anyone had any idea of how to solve this problem, or maybe if something was done about this issue in Godot 3 (it seems to me it is not the case, but I may have missed it!)?
Thanks for your consideration!

Sign In or Register to comment.