Frametime Analyser is a tool that detects duplicate frames in game footage to calculate FPS and frame times
It is inspired by Digital Foundry's FPSGui tool:
Frametime Analyser requires the following prerequisites
- Python 2.7.14
- OpenCV 4.2.0
- Numpy 1.14.3
- Matplotlib 2.2.5
- Clone this repo
- Open
Frametime Analyser.py
in a text editor and setfile_path
to the location of your video - Run
Frametime Analyser.py
Notes
- Input video must be encoded at 60 FPS
- OpenCV decodes video in software, so a fast CPU is recommended. i7-3770 is sufficient for H.264 @ 1080p. H.265 or higher resolutions would require a faster CPU
Key processing steps
- Calculate absolute difference of each pixel relative to previous frame
- Calculate the average difference across the whole frame, giving the value
frame_diff
- Compare
frame_diff
with the exponential moving average offrame_diff
. Ifframe_diff
is significantly lower than the moving average (suggesting a duplicate frame), the frame is counted as a duplicate
- Frametime Analyser assumes the input video is encoded at a constant frame rate of 60 FPS, with dropped frames encoded as duplicate frames
- Frametime Analyser does not account for screen tearing. V-Sync should be enabled when recording the game footage.