title: In gym, how should we implement the environment's render method so that Monitor's produced videos are not black?
body: <p><em>How are we supposed to implement the environment's <a href="https://github.com/openai/gym/blob/master/gym/core.py#L73" rel="nofollow noreferrer"><code>render</code></a> method in gym, so that <code>Monitor</code>'s produced videos are not black (as they appear to me right now)?</em> <em>Or, alternatively, in which circumstances would those videos be black?</em></p>
  <p>To give more context, I was trying to use the gym's wrapper <a href="https://github.com/openai/gym/blob/master/gym/wrappers/monitor.py" rel="nofollow noreferrer"><code>Monitor</code></a>. This wrapper writes (every once in a while, <em>how often exactly?</em>) to a folder some <code>.json</code> files and an <code>.mp4</code> file, which I suppose represents the trajectory followed by the agent (<em>which trajectory exactly?</em>). How is this <code>.mp4</code> file generated? I suppose it's generated from what is returned by the <code>render</code> method. In my specific case, I am using a simple custom environment (i.e. a very simple grid world/maze), where I return a NumPy array that represents my environment's current state (or observation). However, the produced <code>.mp4</code> files are black, while the array clearly is not black (because I am also printing it with matplotlib's <code>imshow</code>). So, maybe <code>Monitor</code> doesn't produce those videos from the <code>render</code> method's return value. <em>So, how exactly does Monitor produce those videos?</em></p>
  <p>(<em>In general, how should we implement <code>render</code>, so that we can produce nice animations of our environments?</em> Of course, the answer to this question depends also on the type of environment, but I would like to have some guidance)</p>