ffmpeg python get total frames

Solutions on MaxInterview for ffmpeg python get total frames by the best coders in the world

showing results for - "ffmpeg python get total frames"
Félix
11 Apr 2019
1import ffmpeg
2
3probe = ffmpeg.probe(path_to_video)
4video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
5num_frames= int(video_info['nb_frames'])