Code Monkey home page Code Monkey logo

smpte's Introduction

SMPTE Timecode Arithmetic Class for Python 2.7/3.x

Usage Examples

s = SMPTE()

# Convert 24 timecode string to frame count (24 is set by default)
tcString = '01:00:00:00'
print(s.getframes(tcString))

# Convert frame count to 29.97 drop frame timecode string
s.fps = 29.97
s.df = True
frameCount = 1800
print(s.gettc(frameCount))

Frame Rates and Drop Frame

All fractional frame rates are rounded up to the nearest integer since all calculations must use integers. There is no need to specify 23.976 when calculating 23.976 timecode since this is covered by the default 24 value.

In fact, the s.fps = 29.97 in the above example will get rounded to 30, but we use 29.97 in the example for historical consistency and clarity--there is no such thing as 30 fps DF TC.

Remember that all timecode except DF is real time clock inaccurate.

We use Andrew Duncan/David Heidelberger method of calculating the drop frame values. See their excellent article at http://www.andrewduncan.net/timecodes/ and https://www.davidheidelberger.com/2010/06/10/drop-frame-timecode/.

smpte's People

Contributors

igorridanovic avatar

Stargazers

Edan avatar Kohei Fujishiro avatar  avatar Mel Matsuoka avatar  avatar  avatar Erich Ocean avatar TJ avatar  avatar Sebastian Reategui avatar justthefracts avatar wangbodbs avatar yann le paih avatar Mel Matsuoka avatar Walter Arrighetti avatar

Watchers

Salvatore Allotta avatar Walter Arrighetti avatar Mel Matsuoka avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.