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

Function _rational_seconds

scenedetect/output/__init__.py:320–328  ·  view source on GitHub ↗

Format a `Fraction` as an FCPXML rational time string. FCPXML expresses time as `` / s`` (or `` s`` for whole seconds). See https://developer.apple.com/documentation/professional-video-applications/fcpxml-reference

(value: Fraction)

Source from the content-addressed store, hash-verified

318
319
320def _rational_seconds(value: Fraction) -> str:
321 """Format a `Fraction` as an FCPXML rational time string.
322
323 FCPXML expresses time as ``<num>/<denom>s`` (or ``<int>s`` for whole seconds). See
324 https://developer.apple.com/documentation/professional-video-applications/fcpxml-reference
325 """
326 if value.denominator == 1:
327 return f"{value.numerator}s"
328 return f"{value.numerator}/{value.denominator}s"
329
330
331def _frame_timecode_seconds(tc: FrameTimecode) -> Fraction:

Callers 1

write_scene_list_fcpxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected