ai2thor
ai2thor copied to clipboard
How to generate a video
Hi,
I find that there is no document or tutorial which shows how to generate a video. I can get the frames after each event and then merge to a video, but it's choppy. Or I can use a screen recording software to record a video from the renderer, but the actions (such as move ahead, rotate and pick up something etc) perform suddenly.
Is there another way to generate a video? I find a file called "video controller.py", but when I run the following code, some errors occur:
from ai2thor.controller import VideoController with VideoController() as vc: vc.play(vc.MoveAhead()) vc.wait(5) vc.play(vc.MoveAhead()) vc.exportVideo('thor.mp4')
And if I want to get a smooth video, what should I do?
Thank you!
Hey, what error did you get from running the code?
Hey, the error was:
~/anaconda3/lib/python3.8/site-packages/ai2thor/controller.py in init(self, quality, fullscreen, headless, port, start_unity, local_executable_path, width, height, x_display, host, scene, image_dir, save_image_per_frame, docker_enabled, depth_format, add_depth_noise, download_only, include_private_scenes, server_class, **unity_initialization_parameters) 445 ) 446 --> 447 event = self.reset(scene) 448 if event.metadata['lastActionSuccess']: 449 init_return = event.metadata['actionReturn']
AttributeError: 'VideoController' object has no attribute 'initial_cam_rot'
Same error. @laopao2002 and @mattdeitke PR https://github.com/allenai/ai2thor/pull/856 fixes this bug