framerate = 24

def timecode_to_frames(timecode):
    return sum(f * int(t) for f, t in zip((3600 * framerate, 60 * framerate,
        framerate, 1), timecode.split(':')))
How to do timecode calculation?