Movie maker mode produces strange recordings when trying to use a different resolution

Godot Version

v4.2.1.stable.mono.official [b09f793f5]

Question

I’d like to record looping videos showing character models and animations playing in Godot, using the game’s lighting and shaders, and unlike the game project itself I’d like these videos to have a square aspect ratio.

Currently, my project is configured to normally have a window size of 1280x720 and has stretch mode set to “disabled”:

image

I set up the root node of a scene like so, expecting this window size to be used for the recorded video:

extends Node3D

@export var window_override: bool = true
@export var window_override_size: Vector2i = Vector2i(512, 512)

func _enter_tree():
    if self.window_override:
        self.get_window().size = self.window_override_size

Here’s what it looks like when the game is running, as expected:

But here’s what it looks like in the recorded video. It strangely has a resolution of 512x1024 instead of 512x512, and is stretched on the vertical axis:

How can I fix this? The video resolution is as expected if I overwrite the project-wide settings, but it seems very tedious and unnecessary to do this any time I want to create a video this way. Is there something else I can do to set the resolution programmatically, or at least set a different resolution for movie mode?

Weird. Tested this on macOS with Godot v4.2.2.stable.official. Renders the video at 512x512 as expected.

I’ve been able to work around this for now (on Windows 10) by recording to PNG+WAV format, which is at the correct resolution and not distorted, and then re-encoding with ffmpeg. But I still haven’t found a way to make the AVI output work as expected. It would be nice if the extra encoding step were not necessary!

1 Like