title: Convert Timecode to Frames with set start timecode
body: <p>I am using the below script to convert timecode to frames, which works but is only converting with a start timecode of 00:00:00:00. I want to be able to set the start timecode so the calculation is relative. Also it breaks if I se the frame rate to 23.976 or 29.97.</p>
  
  <pre><code>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(':')))
  
  def frames_to_timecode(frames):
      return '{0:02d}:{1:02d}:{2:02d}:{3:02d}'.format(frames / (3600*framerate),
                                                      frames / (60*framerate) % 60,
                                                      frames / framerate % 60,
                                                      frames % framerate)
  
  print timecode_to_frames('00:00:00:10')
  print frames_to_timecode(10)
  </code></pre>