Record Gameplay in runtime and export

Is there any way in unreal to record a gameplay in runtime and save it to disk in runtime

Unreal has a replay system ready to use. I haven’t used it but you can check the documentation for more details:

nope this cant be used to save video and replay system, is related replication and stuff

In my case, i should be able to record gameplay video with UI and save it in disk in playable media format for ex: mp4

Sorry, I did not understand that you were talking about video.

I think it’s only available for cut-scenes in the editor but you might be able to get UMovieSceneCapture working for you in C++. However expect it to have a large impact on your game’s performance.

Check this discussion: How do i record video in game

You can record on almost any platform using Runtime Video Recorder:
https://www.fab.com/listings/b51f5253-d2c0-4281-bacf-5d84292dd1ee