def _get_start_end(row): start = float(row['new_phase_start']) start = max(0., start) end = float(row['new_phase_end']) clip = VideoFileClip(row['video_path']) end = min(end, clip.duration) clip.__del__() return start, end
def video_length(video_path): clip = VideoFileClip(video_path) duration = clip.duration clip.__del__() return duration