Skip to content

Commit

Permalink
Fix from #165
Browse files Browse the repository at this point in the history
  • Loading branch information
JacopoPan committed Aug 16, 2023
1 parent 73f8332 commit 519fe6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gym_pybullet_drones/envs/BaseAviary.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,13 @@ def _startVideoRecording(self):
"""Starts the recording of a video output.
The format of the video output is .mp4, if GUI is True, or .png, otherwise.
The video is saved under folder `files/videos`.
"""
if self.RECORD and self.GUI:
VIDEO_FOLDER = os.path.join(self.OUTPUT_FOLDER, "recording_" + datetime.now().strftime("%m.%d.%Y_%H.%M.%S"))
os.makedirs(os.path.dirname(VIDEO_FOLDER), exist_ok=True)
self.VIDEO_ID = p.startStateLogging(loggingType=p.STATE_LOGGING_VIDEO_MP4,
fileName=os.path.join(self.OUTPUT_FOLDER, "recording_" + datetime.now().strftime("%m.%d.%Y_%H.%M.%S"), "output.mp4"),
fileName=os.path.join(VIDEO_FOLDER, "output.mp4"),
physicsClientId=self.CLIENT
)
if self.RECORD and not self.GUI:
Expand Down

0 comments on commit 519fe6b

Please sign in to comment.