Recording videos with multiagent env

I’m working on getting saving videos to work in multiagent envs.
I have tried the example env_rendering_and_recording.py from the newest stable release and nightly. It correctly creates videos in the single-agent setting. However, once I activate the flag --multi-agent the video folder is created but not videos are created inside.
Can anybody reproduce this? Am I doing something wrong? I’m just running the example code unmodified.

1 Like

After further fixes I found the problem:
MultiAgentCustomRenderedEnv does not have metadata, while CustomRenderedEnv has

metadata = {
    "render.modes": ["rgb_array"],
}

which is necessary for recording to take place.
I inserted MultiAgentCustomRenderedEnv.metadata = CustomRenderedEnv.metadata in line 94 as a workaround and now videos are correctly generated.

1 Like

Awesome @PavelC , thanks for posting the solution here. Great catch! Could you create a fix-it PR with the suggested changes and assign me on the PR?

Sure, I’ll see to it that I open a PR.