Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of hardware accelerated video encoding (ex: NVENC) in Movie Maker mode #11813

Open
jitspoe opened this issue Feb 20, 2025 · 1 comment

Comments

@jitspoe
Copy link

jitspoe commented Feb 20, 2025

Describe the project you are working on

Retro FPS.

Describe the problem or limitation you are having in your project

The current movie maker causes the game to run extremely slowly, making it difficult to record natural looking footage. It typically ends up looking jerky and twitchy. The files are also extremely large, and like 4/5 of the tools I use do not properly support the format Godot currently outputs, and reencoding loses quality. h.264 mp4 files are much more widely supported.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Using something like NVENC would allow the files to both be compressed better and free up the CPU so the game runs smoothly while recording. I can record in OBS with little to no performance hit, but movie maker is nice as it prevents any inconsistent framerate and dropped frames.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Ideally this would be transparent to the user and the movie maker mode would just run faster. There could be options to use the old avi format if desired, I guess.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

I haven't fully explored the feasibility of making this an addon. It might be possible.

Also related: #4710

@Calinou
Copy link
Member

Calinou commented Feb 20, 2025

We can get much faster encoding without having to pull in the entirety of FFmpeg (which is massive), or having to call it externally after recording uncompressed video:

Combining both should easily lead to 20x faster encoding if not more. Check the benchmark I posted at godotengine/godot#91263 to see how much QOI encoding improves things over PNG. You still need to convert the video to H.264 afterwards, but doing this as a post-process will always lead to better quality, as you can spend more time doing it and can use CPU-based encoders (which are higher-quality than GPU-based encoders).

That said, #4710 is the most realistic avenue for implementing this. It can already be implemented as an add-on using GDExtension.

@Calinou Calinou changed the title Make use of hardware accelerated video encoding (ex: NVENC) in Movie Maker mode. Make use of hardware accelerated video encoding (ex: NVENC) in Movie Maker mode Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants