If your game engine is a recent version of Unity3D (2017.1.0 or higher), there is a free official asset by Unity Technologies itself called Recorder in the Unity Asset Store (with source code also available on Github).
It is still tagged experimental but seems stable enough to be useful (but check the Unity Forum, linked below, first as some experience problems) and is integrated in the Editor (in its own window).
You can find it:
- In the Unity Asset Store: https://assetstore.unity.com/packages/essentials/beta-projects/recorder-94079
- On Github: https://github.com/Unity-Technologies/GenericFrameRecorder
- Unity Forum thread: https://forum.unity.com/threads/unity-recorder-update.509458/
For reference, it supports (copied from the Asset Store Link):
- Dedicated recorder window
- Timeline triggerable recording sessions
- Image sequences: JPG, PNG, GIF, OpenEXR
- Video files: WebM, H.264 (Windows only)
- Animation clips
- 360 degree images/video capture (2018.1+)