X Tutup
Skip to content

Fix MovieWriter checking wrong directory for disk space#113398

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
Eshaan-byte:fix-moviewriter-disk-space-check
Dec 2, 2025
Merged

Fix MovieWriter checking wrong directory for disk space#113398
akien-mga merged 1 commit intogodotengine:masterfrom
Eshaan-byte:fix-moviewriter-disk-space-check

Conversation

@Eshaan-byte
Copy link
Contributor

Fixes #113391

MovieWriter was incorrectly checking disk space on the current working directory instead of the target output directory specified in --write-movie.

Changes

Changed get_basename() to get_base_dir() in movie_writer.cpp:117 to properly extract the directory path where the movie file will be written.

Before:

  • get_basename() on /path/to/output.avi/path/to/output (not a valid directory)
  • dir->open() would open the current working directory

After:

  • get_base_dir() on /path/to/output.avi/path/to (correct directory)
  • dir->open() opens the actual target directory

Impact

  • Users will now get accurate disk space warnings for the target directory
  • Prevents false positives when CWD has low space but target has plenty
  • Prevents missing warnings when target has low space but CWD has plenty

MovieWriter was using get_basename() which strips the file extension
but keeps the filename, resulting in checking the current working
directory instead of the target output directory.

Changed to use get_base_dir() to properly extract the directory path
where the movie file will actually be written.

Fixes godotengine#113391
@AThousandShips AThousandShips requested a review from a team December 1, 2025 14:09
@AThousandShips AThousandShips added the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Dec 1, 2025
@AThousandShips AThousandShips added this to the 4.6 milestone Dec 1, 2025
@akien-mga akien-mga merged commit 8cee535 into godotengine:master Dec 2, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@timothyqiu
Copy link
Member

Note that this did not fix the issue.

The MRP script from #113391 still warns incorrectly.

timothy@ribbon tmp $ df -h .
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           7.7G  4.1G  3.7G  53% /tmp
timothy@ribbon tmp $ df -h ~/Desktop/
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p3  467G  393G   51G  89% /
timothy@ribbon tmp $ ~/repos/godot-master/bin/godot.linuxbsd.editor.dev.x86_64 --script test.gd --write-movie ~/Desktop/movie.avi
Godot Engine v4.6.dev.custom_build.5f12ada7a (2025-12-02 13:17:38 UTC) - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 580.105.08 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 3060 Ti

Movie Maker mode enabled, recording movie at 60 FPS...
WARNING: Current available space on disk is low (3.66 GiB). MovieWriter will fail during movie recording if the disk runs out of available space.
     at: begin (servers/movie_writer/movie_writer.cpp:124)
Space left: 50.38 GiB
--------------------------------------------------------------------------------
Done recording movie at path: /home/timothy/Desktop/movie.avi
18 frames at 60 FPS (movie length: 00:00:00:18), recorded in 00:00:02 (50% of real-time speed).
CPU render time: 0.01 seconds (average: 0.32 ms/frame)
GPU render time: 0.00 seconds (average: 0.06 ms/frame)
Encoding time: 0.34 seconds (average: 18.95 ms/frame)
--------------------------------------------------------------------------------

@akien-mga akien-mga removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Movie Maker checking the wrong directory for available disk space

4 participants

X Tutup