moviepy.video.tools.cuts.find_video_period#

moviepy.video.tools.cuts.find_video_period(clip, fps=None, start_time=0.3)[source]#

Find the period of a video based on frames correlation.

Parameters:
  • clip (moviepy.Clip.Clip) -- Clip for which the video period will be computed.

  • fps (int, optional) -- Number of frames per second used computing the period. Higher values will produce more accurate periods, but the execution time will be longer.

  • start_time (float, optional) -- First timeframe used to calculate the period of the clip.

Examples

from moviepy import *
from moviepy.video.tools.cuts import find_video_period

clip = VideoFileClip("media/chaplin.mp4").subclipped(0, 1).loop(2)
round(videotools.find_video_period(clip, fps=80), 6)
1