geek-ai / MAgent

A Platform for Many-Agent Reinforcement Learning
MIT License
1.68k stars 332 forks source link

Is there a way to save rendering result as video file(ex: .mp4)? #24

Closed sunfanyunn closed 6 years ago

sunfanyunn commented 6 years ago

Of course I can use something like selenium and save screenshots to form a video later. But is there any easier or better way of doing this?

Kipsora commented 6 years ago

Currently, our render has not provided a way to save a standalone version of videos like MP4, MPEG and AVI. We have a very big map with millions of agents so basically we cannot save all of them into one video. But we might add some utilities to save the rendered episode in a clipped window.

sunfanyunn commented 6 years ago

image

How can I change the parameters in "Window" programatically? Is it possible?

sunfanyunn commented 6 years ago

I am just wondering how is the gif that are used to demo(in the READMD.md) created? I would like to do the same thing with my self-designed game. Thanks in advance !

Kipsora commented 6 years ago

Currently the properties of window can be only modified by pressing Up, Down, Left and Right (see here). If you want to change it in a program, you may send the respective keys to the browser (but currently the render is only for the purpose of watching how agents perform).

Kipsora commented 6 years ago

The video in the README is firstly recorded by screen recording programs like Vokoscreen and then converted into GIF format using ffmpeg.

sunfanyunn commented 6 years ago

Thanks a lot!