I have a video that was recorded at 120 fps. When I look at the video properties in Windows, it is confirmed to be 120 fps.
And also in VLC:
However, when I use either moviepy or cv2 in Python, I get the incorrect frame rate of 25 fps.
import cv2
from moviepy.editor import *
def main():
# Define file name
video_name = r'C:\Users\npires.OMG\OneDrive - OMG PLC\Work Projects\Convert AVI to MP4 H264\Test\Test\Walk ' \
r'01.2117813.20210614134127.avi'
# import the video into Python
video_data_cv2 = cv2.VideoCapture(video_name)
video_data_moviepy = VideoFileClip(video_name)
# get the video frame rate
fps_moviepy = video_data_moviepy.fps
fps_cv2 = video_data_cv2.get(cv2.CAP_PROP_FPS)
I get a frame rate of 25 FPS.
I don't know why there's a discrepancy between moviepy and Windows/VLC (which are correct).
EDIT: Here is a copy of the example video that I am using. It has been compressed using 32-bit FFDshow codec.