Skip to content

Conversation

@billybjork
Copy link

Summary

The VideoWriter class was not closing the depth video writer in its close() method, causing depth map video files (.depth.mp4) to be corrupted/unplayable.

Problem

When using VideoWriter with render_depth=True, the depth video files are never finalized because close() only closes image_writer:

def close(self):
    """Finish writing."""
    self.image_writer.close()
    # depth_writer is never closed!

The imageio writer requires close() to be called to write the video file headers and finalize the container.

Fix

  1. Initialize self.depth_writer = None before the conditional assignment (also fixes a potential AttributeError if render_depth=False and code elsewhere checks self.depth_writer)
  2. Close depth_writer in the close() method if it exists

Testing

Verified that depth map videos are now playable after this fix.

The VideoWriter class was not closing the depth video writer, causing
corrupted/unplayable depth map video files. The imageio writer requires
close() to be called to finalize the video file.

Changes:
- Initialize self.depth_writer = None before conditional assignment
  (fixes potential AttributeError when render_depth=False)
- Add depth_writer.close() call in close() method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant