title: Gym wrapper videorecorder is not working properly on Hopper-v2 environment. Gives segmentation fault
body: <p>I am trying to save a video of the render of my Hopper-v2 environment, however it gives a segmentation fault error. I have made a short code example to reproduce the issue.</p>
  <pre><code>import os
  from gym.wrappers.monitoring.video_recorder import VideoRecorder
  
  path_project = os.path.abspath(os.path.join(__file__, &quot;..&quot;))
  path_of_video_with_name = os.path.join(path_project, &quot;videotest.mp4&quot;)
  env = gym.make('Hopper-v2') # for making environment
  state = env.reset()
  video_recorder = None
  video_recorder = VideoRecorder(env, path_of_video_with_name, enabled=True)
  
  for _ in range(1000):
     env.render()
     video_recorder.capture_frame()
     env.step(env.action_space.sample()) # take a random action
  
  print(&quot;Saved video.&quot;)
  
  video_recorder.close()
  video_recorder.enabled = False
  env.close()
  </code></pre>
  <p>This gives the error:
  Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)</p>
  <p>It does create a video though, which is only 14 frames long, then it gets interrupted. By commenting out the 'video_recorder.capture_frame()' line, it will render the complete episode. Using the cartpole environment instead of the hopper, does work and saves the complete episode.</p>
  <p>I am using Linux 20.0.4 (Ubuntu), Gym version 0.21.0 using <code>pip install gym</code>, python version 3.7.6.</p>
  <p>If anyone has any idea, please let me know</p>