|
1 | 1 | # TimecodeKit |
2 | 2 |
|
3 | | -<p> |
4 | | -<a href="https://developer.apple.com/swift"> |
5 | | -<img src="https://img.shields.io/badge/Swift%205.3-compatible-orange.svg?style=flat" |
6 | | - alt="Swift 5.3 compatible" /></a> |
7 | | -<a href="#installation"> |
8 | | -<img src="https://img.shields.io/badge/SPM-compatible-orange.svg?style=flat" |
9 | | - alt="Swift Package Manager (SPM) compatible" /></a> |
10 | | -<a href="https://developer.apple.com/swift"> |
11 | | -<img src="https://img.shields.io/badge/platform-macOS%20|%20iOS%20|%20tvOS%20|%20watchOS-green.svg?style=flat" |
12 | | - alt="Platform - macOS | iOS | tvOS | watchOS" /></a> |
13 | | -<a href="#contributions"> |
14 | | -<img src="https://img.shields.io/badge/Linux-not%20tested-black.svg?style=flat" |
15 | | - alt="Linux - not tested" /></a> |
16 | | -<a href="https://github.com/orchetect/TimecodeKit/blob/main/LICENSE"> |
17 | | -<img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat" |
18 | | - alt="License: MIT" /></a> |
19 | | -</p> |
20 | | -A robust multi-platform Swift library for working with SMPTE timecode supporting 20 industry frame rates, and including methods to convert to/from timecode strings and perform calculations. |
21 | | - |
22 | | -## Supported Frame Rates |
23 | | - |
24 | | -| NTSC | PAL | HD / Film | Other | |
25 | | -| --------- | ---- | --------- | ------ | |
26 | | -| 29.97 | 25 | 23.976 | 30 | |
27 | | -| 29.97 DF | 50 | 24 | 30 DF | |
28 | | -| 59.94 | 100 | 24.98 | 60 | |
29 | | -| 59.94 DF | | 47.952 | 60 DF | |
30 | | -| 119.88 | | 48 | 120 | |
31 | | -| 119.88 DF | | | 120 DF | |
| 3 | +[](https://github.com/orchetect/TimecodeKit/actions/workflows/build.yml) [](https://developer.apple.com/swift) [](https://github.com/orchetect/TimecodeKit/blob/main/LICENSE) |
| 4 | + |
| 5 | +A robust and precise Swift library for working with SMPTE timecode supporting 20 industry frame rates, including conversions to/from timecode strings and timecode-based calculations. |
| 6 | + |
| 7 | +## Supported Timecode Frame Rates |
| 8 | + |
| 9 | +The following BITC frame rates are supported. These are used widely in DAWs (digital audio workstation software) and video editing applications. |
| 10 | + |
| 11 | +| Film / ATSC / HD | PAL / SECAM / DVB / ATSC | NTSC / ATSC / PAL-M | NTSC Non-Standard | ATSC | |
| 12 | +| ---------------- | ------------------------ | ------------------- | ----------------- | ---- | |
| 13 | +| 23.976 | 25 | 29.97 | 30 DF | 30 | |
| 14 | +| 24 | 50 | 29.97 DF | 60 DF | 60 | |
| 15 | +| 24.98 | 100 | 59.94 | 120 DF | 120 | |
| 16 | +| 47.952 | | 59.94 DF | | | |
| 17 | +| 48 | | 119.88 | | | |
| 18 | +| | | 119.88 DF | | | |
32 | 19 |
|
33 | 20 | ## Core Features |
34 | 21 |
|
35 | 22 | - Convert timecode values to timecode display string, and vice-versa |
36 | 23 | - Convert timecode values to real wall-clock time, and vice-versa |
37 | 24 | - Convert timecode to # of samples at any audio sample-rate, and vice-versa |
38 | 25 | - Granular timecode validation |
39 | | -- A `Formatter` object that can format timecode and also provide an `NSAttributedString` showing invalid timecode components using alternate attributes (such as red text color) |
40 | 26 | - Support for Days as a timecode component (which Cubase supports as part of its timecode format) |
41 | 27 | - Support for Subframes |
42 | 28 | - Common math operations between timecodes: add, subtract, multiply, divide |
43 | 29 | - Form a `Range` or `Stride` between two timecodes |
44 | | -- Exhaustive unit tests ensuring accuracy |
45 | 30 | - Conforms to `Codable` |
| 31 | +- A `Formatter` object that can format timecode and also provide an `NSAttributedString` showing invalid timecode components using alternate attributes (such as red text color) |
| 32 | +- A SwiftUI `Text` object showing invalid timecode components using alternate attributes (such as red text color) |
| 33 | +- Exhaustive unit tests ensuring accuracy |
46 | 34 |
|
47 | 35 | ## Installation |
48 | 36 |
|
@@ -479,6 +467,10 @@ for tc in stride(from: startTC, to: endTC, by: 5) { |
479 | 467 | - Workaround: Don't run unit tests for a watchOS target |
480 | 468 | - The Dev Tests are not meant to be run as routine unit tests, but are designed as a test harness to be used only when altering critical parts of the library to ensure stability of internal calculations. |
481 | 469 |
|
| 470 | +## References |
| 471 | + |
| 472 | +- Wikipedia: [SMPTE Timecode](https://en.wikipedia.org/wiki/SMPTE_timecode) |
| 473 | + |
482 | 474 | ## Author |
483 | 475 |
|
484 | 476 | Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself [@orchetect](https://github.com/orchetect). |
|
0 commit comments