def get_frames(self): """ Get total frame count of input file, returning total_frames from project if already exists """ # TODO: Unify get frames with vs pipe cache generation if self.frames > 0: return self.frames if self.chunk_method in ("vs_ffms2", "vs_lsmash"): vs = ( self.input if self.is_vs else create_vs_file(self.temp, self.input, self.chunk_method) ) fr = frame_probe_vspipe(vs) if fr > 0: self.frames = fr return fr total = frame_probe_fast(self.input, self.is_vs) self.frames = total return self.frames
def frame_probe(source: Path): """ Determines the total number of frames in a given input. Differentiates between a Vapoursynth script and standard video and delegates to vspipe or ffmpeg respectively. """ if is_vapoursynth(source): return frame_probe_vspipe(source) return frame_probe_ffmpeg(source)