mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 17:00:46 +00:00
Update broadcast_timecode.py
File reformat
This commit is contained in:
@@ -72,6 +72,7 @@ def frame_count_to_smpte(frame_count: int, frames_per_logical_second: int, drop_
|
||||
else:
|
||||
return "%02i:%02i:%02i%s%02i" % (hh, mm, ss, separator, ff)
|
||||
|
||||
|
||||
def footage_to_frame_count(footage_string, include_fractional=False):
|
||||
m = re.search("(\d+)\+(\d+)(\.\d+)?", footage_string)
|
||||
feet, frm, frac = m.groups()
|
||||
@@ -84,10 +85,12 @@ def footage_to_frame_count(footage_string, include_fractional = False):
|
||||
else:
|
||||
return frames
|
||||
|
||||
|
||||
def frame_count_to_footage(frame_count, fractional_frames=None):
|
||||
assert fractional_frames < 1.0 or fractional_frames is None
|
||||
assert fractional_frames is None or fractional_frames < 1.0
|
||||
feet, frm = divmod(frame_count, 16)
|
||||
if fractional_frames:
|
||||
|
||||
if fractional_frames is None:
|
||||
return "%i+%02i" % (feet, frm)
|
||||
else:
|
||||
return "%i+%02i%s" % (feet, frm, ("%.3f" % fractional_frames)[1:])
|
||||
Reference in New Issue
Block a user