How can I record gameplay in game using UE4?

I want to record footage of what my player character sees when in game at the press of a key and have this footage saved. I don’t want to use external software such as OBS, I want to use UE4 to record about 10 seconds of video after a key press. How can this be done?