MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / calculate_timecode

Function calculate_timecode

scenedetect/_cli/controller.py:194–199  ·  view source on GitHub ↗
(value: str)

Source from the content-addressed store, hash-verified

192 col_idx = csv_headers.index(context.load_scenes_column_name)
193
194 def calculate_timecode(value: str) -> FrameTimecode:
195 # Assume other columns are in seconds except frame numbers.
196 if value.isdigit():
197 # Frame numbers start from index 1 in the CLI output so we correct for that.
198 return FrameTimecode(int(value) - 1, fps=video_stream.frame_rate)
199 return FrameTimecode(value, fps=video_stream.frame_rate)
200
201 cut_list = sorted(calculate_timecode(row[col_idx]) for row in file_reader)
202 # `SceneDetector` works on cuts, so we have to skip the first scene and place the first

Callers 1

_load_scenesFunction · 0.85

Calls 1

FrameTimecodeClass · 0.90

Tested by

no test coverage detected