Record Video on BGE

Good evening,

Is there any way to record as a video what is happening within the Game Engine environment?

I already use the screenshot to do screen capture through a key, but now, I would like to record everything that happens from the moment I run the BGE Runtime mode, until the moment it is closed, like an .mp4 for example.
I am doing an ROV simulation from coordinates, and I need to record this simulation I did in BGE.

Can I do this in Python?

Thank you all.

Depends on how you want to record it.
.mp4 you say, no you can not with bge but you can use OBS (open broadcast software) to record anything you like on your pc.

OR

Nicholas_A made an ingame recording/playback system in the BGE, if that is something you like, you can find it here: https://blenderartists.org/forum/showthread.php?396871-Game-play-recorder-rewind-system&highlight=game+recording

As mentioned by Cotaks, my recording system records position, orientation, scale, color, state, visibility, every frame, of every object marked with the property for recording. The recording can be saved to a file and played again.