📅  最后修改于: 2022-03-11 14:46:21.638000             🧑  作者: Mango
import ffmpeg
probe = ffmpeg.probe(path_to_video)
video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
num_frames= int(video_info['nb_frames'])