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

Class TimecodeFormat

scenedetect/_cli/config.py:310–327  ·  view source on GitHub ↗

Format to display timecodes.

Source from the content-addressed store, hash-verified

308
309
310class TimecodeFormat(Enum):
311 """Format to display timecodes."""
312
313 FRAMES = 0
314 """Print timecodes as exact frame number."""
315 TIMECODE = 1
316 """Print timecodes in format HH:MM:SS.nnn."""
317 SECONDS = 2
318 """Print timecodes in seconds SSS.sss."""
319
320 def format(self, timecode: FrameTimecode) -> str:
321 if self == TimecodeFormat.FRAMES:
322 return str(timecode.frame_num)
323 if self == TimecodeFormat.TIMECODE:
324 return timecode.get_timecode()
325 if self == TimecodeFormat.SECONDS:
326 return f"{timecode.seconds:.3f}"
327 raise RuntimeError("Unhandled format specifier.")
328
329
330class FcpFormat(Enum):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected