Because the safety env class doesn't have the field metadata = {'render.modes': ["rgb_array", "human"]}, VideoRecorder won't be enabled (see https://github.com/openai/gym/blob/master/gym/wrappers/monitoring/video_recorder.py#L41). I can see that safety env does support rendering in "rgb" mode, so adding this field in the class will resolve the issue.
Because the safety env class doesn't have the field
metadata = {'render.modes': ["rgb_array", "human"]}
,VideoRecorder
won't be enabled (see https://github.com/openai/gym/blob/master/gym/wrappers/monitoring/video_recorder.py#L41). I can see that safety env does support rendering in "rgb" mode, so adding this field in the class will resolve the issue.