我在试着把视频转换成帧。我有一个函数可以做到这一点,但我不知道如何获得不同的帧速率。
我使用的函数是:
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帧。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐