minosworld / minos

MINOS: Multimodal Indoor Simulator
MIT License
201 stars 33 forks source link

How to save the navigational path video? #51

Open hasifast opened 6 years ago

hasifast commented 6 years ago

I want to record the video of navigation similar to the one given in the demo video of MINOS. Please guide me if there is any option available to record it without using desktop screen recorder etc.

msavva commented 6 years ago

There are two command line options that can be used for saving a video:

  1. --save_video for example python3 -m minos.tools.pygame_client --save_video test.avi
  2. --save_png for example python3 demo.py --env_config pointgoal_suncg_sf --task point_goal --save_png

The first encodes a video on the fly, while the latter saves numbered sequences of png images for each of the enabled sensors in the logs/<timestamp> directory for the given run. You can convert these image sequences into videos using ffmpeg or similar tools. The latter option is recommended for higher quality and for converting to videos of a desired resolution and format.

latifAnjum commented 6 years ago

By using the command "python3 -m minos.tools.pygame_client --save_video test.avi" i get the error

2018-05-24 11:11:40,688 INFO {'sim_git_hash': '3bf7fb6', 'machine': 'latif-Lenovo-ideapad-310-15IKB', 'stk_git_hash': '3bf7fb6', 'sim_id': 'sim00'} Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/latif/Desktop/minos/minos/tools/pygame_client.py", line 457, in main() File "/home/latif/Desktop/minos/minos/tools/pygame_client.py", line 423, in main VIDEO_WRITER = VideoWriter(filename, framerate=24, resolution=(args.width, args.height), rgb=is_rgb) File "/home/latif/Desktop/minos/minos/lib/util/VideoWriter.py", line 33, in init self.proc = sp.Popen(command, stdin=sp.PIPE, stderr=sp.PIPE) File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg' Exception ignored in: <bound method VideoWriter.del of <minos.lib.util.VideoWriter.VideoWriter object at 0x7fe6ed2a7390>> Traceback (most recent call last): File "/home/latif/Desktop/minos/minos/lib/util/VideoWriter.py", line 44, in del self.close() File "/home/latif/Desktop/minos/minos/lib/util/VideoWriter.py", line 39, in close self.proc.stdin.close() AttributeError: 'VideoWriter' object has no attribute 'proc' 2018-05-24 11:11:42,355 INFO sim00:Stopping the simulator 2018-05-24 11:11:42,355 INFO Counter() 2018-05-24 11:11:42,355 INFO sim00:Stopping child servers 2018-05-24 11:11:42,355 INFO sim00:Stopped child servers 2018-05-24 11:11:42,355 INFO sim00:Simulator killed.

msavva commented 6 years ago

The above error is due to the system not having ffmpeg installed. Please install ffmpeg through apt-get, brew or other package manager depending on your OS.