mujoco-py icon indicating copy to clipboard operation
mujoco-py copied to clipboard

MjViewer recording shadow screen after pressing "v"

Open a-z-e-r-i-l-a opened this issue 4 years ago • 3 comments

When I press "V" on keyboard to record a video of the simulation, a shadow screen is added to the gui which does not go away unless I press V again to stop recording. This shadow screen also gets recorded. Example:

Is there a way to prevent this?

Screenshot from 2020-04-19 21-50-24

a-z-e-r-i-l-a avatar Apr 19 '20 19:04 a-z-e-r-i-l-a

Are your surfaces really reflective? is your light source focal?

stefanwanckel avatar May 07 '21 17:05 stefanwanckel

Are your surfaces really reflective? is your light source focal?

no only when I press V to start recording.

a-z-e-r-i-l-a avatar May 07 '21 17:05 a-z-e-r-i-l-a

Hi, I have solved this problem. The issue is that when you press V for recording, Mujuco start to overwrite the original screen resolution but somehow did not clear the original one. So you saw the shadow images in the video. The solution is pretty simple, you just have to comment out the overwriting codes: In mjviewer.py, line 217 - line 220:

# resolution = np.array(resolution)
# resolution = resolution * min(1000 / np.min(resolution), 1)
# resolution = resolution.astype(np.int32)
# resolution -= resolution % 16

Hope this helps.

y8han avatar Feb 07 '23 17:02 y8han