godot-proposals
godot-proposals copied to clipboard
Implement `get_stream_length()` for built-in supported video formats
Describe the project you are working on
I'm currently working on a 3D psychological horror game that makes use of video extensively as a method for story telling.
Describe the problem or limitation you are having in your project
I want some of these videos to be fully interactive, as of right now I can only start and stop the videos, I can't seek videos, and I can't do verification on it's audio (I have a system set up to where if I want to I can make the video's audio play through an audio stream player, but as of right now any audio can be used with any video and not only the audio that's the exact length as the video can be used). As per the documentation the get_stream_length() and set_stream_position() isnt implemented at all for theora
Describe the feature / enhancement and how it helps to overcome the problem or limitation
implementing the stream length and allowing seeking can save a lot of confusion because to me seeing as getting the length, getting the current positon etc. is already implemented for the audio streams, why wouldn't it be implemented for the video streams. I get that in the documentation it says it's not implemented but that was after a lot of confusion as to why A. get_stream_length() just returns 0 and B. why seeking doesn't do anything. especially since at a cursory glance Theora and Vorbis seem to be very similar.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I'm not really well versed in decoder programming, but couldn't a similar solution used for Vorbis work for Theora? or if that couldn't work, couldn't using the video's audio track work for at least determining the length of the video and where the current video stream is?
If this enhancement will not be used often, can it be worked around with a few lines of script?
As per documentation this can be worked around using a separate GDExtension that implements it's own format
Is there a reason why this should be core and not an add-on in the asset library?
most people who either are starting out with godot, or have been working on a project for a while will most likely be using whatever format is by default built in, and will continue using it until they eventually reach some point where they do need to get the length of the video or seek the video, in this case there's only a few options, either get a GDExtension that implements these functions and then re-encode all of their videos, completely pivot their idea to no longer need that functionality, or move completely away from godot as functionality like this is present in other engines.
for the most part beginners in this situation will be inclined to move to a new engine