Skip to content

Support for timecodes in format HH:MM:SS+FF #65

@edi-spaghetti

Description

@edi-spaghetti

This format is used in some Film and TV contexts, but is not supported currently. The following throws an error;

Python 3.9.16 (main, Aug 13 2024, 14:41:47) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import timecode
>>> timecode.Timecode('23.976', '19:29:00+21')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/users/edwardspencer/pipeline/virtual_envs/timecode-test/lib/python3.9/site-packages/timecode/__init__.py", line 94, in __init__
    self.frames = self.tc_to_frames(start_timecode)
  File "/users/edwardspencer/pipeline/virtual_envs/timecode-test/lib/python3.9/site-packages/timecode/__init__.py", line 258, in tc_to_frames
    hours, minutes, seconds, frames = map(int, self.parse_timecode(timecode))
  File "/users/edwardspencer/pipeline/virtual_envs/timecode-test/lib/python3.9/site-packages/timecode/__init__.py", line 493, in parse_timecode
    secs = int(bfr[2])
ValueError: invalid literal for int() with base 10: '00+21'

This was tested on python 3.9 with timecode module 1.4.1
Of course, we can parse the string before initialising a Timecode object, but it would be nice if this was supported natively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions