我正在尝试将视频转换为帧。我有一个函数可以执行此操作,但是我不知道如何获得不同的帧速率。
我正在使用的功能是:
def FrameCapture(video_path,video_name,images_path):
# Path to video file
vidObj = cv2.VideoCapture(video_path)
# Used as counter variable
count = 0
# checks whether frames were extracted
success = 1
while success:
# vidObj object calls read
# function extract frames
success, image = vidObj.read()
# Saves the frames with frame-count
cv2.imwrite(images_path+'\\'+"%d.jpg" % count, image)
count += 1
然后称呼它:
FrameCapture('path1\\dance.mp4','dance','path1\\test')
我需要将其转换为每秒8帧。