Render Camera view to texture and then REPLAY?

Is there a way to record the camera and play it back later with render to texture or something similar? Can you write the camera output (data or image) to a file for playback later?

For example a player can press ‘replay’ or even rewind or fast forward the security camera?

How would one go about implementing a feature like replay

Initial Reference
I saw this thread on how to render a camera view to a texture.
Render Camera view to texture