Hi,
I’m currently working with the Omniverse Kit app in headless mode (kit_service), and it needs to be containerized for my use case. The goal is to capture and export the images of model from different cameras at various angles on the stage. However, since the app is running in headless mode my current approach to capture the model in is failing.
Here’s the code I’ve been using to attempt the capture:
from omni.kit.capture.viewport import CaptureExtension, CaptureOptions
class image_capture():
def __init__(self):
self._capture = CaptureExtension.get_instance()
async def on_capture_images():
for i, camera_path in enumerate(self.cameras):
print(f"Capturing from camera {i+1}/{len(self.cameras)}")
self._capture.options = CaptureOptions(
camera=camera_path,
fps=24.0,
start_frame=1,
end_frame=1,
res_width=1000,
res_height=500,
output_folder=self._output_dir,
file_name=f"image_{i:03d}",
save_alpha=True,
overwrite_existing_frames=True,
)
self._capture.start()
But I am encountering the following error:
Capturing images from 5 cameras...
Capturing from camera 1/5
2025-03-21 11:26:31 [15,827ms] [Warning] [omni.kit.capture.viewport.extension] Capture couldn't be started due to failed to prepare viewport for capture.
Has anyone encountered a similar issue with capturing/exporting in headless mode, especially when the app is containerized? Any guidance for handling this scenario would be greatly appreciated.
Thank you!
Pranav