Skip to content

Commit eb9e906

Browse files
authored
Merge branch 'master' into sonatype
2 parents e1bb8d7 + 26da2a8 commit eb9e906

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/badges/branches.svg

Lines changed: 1 addition & 0 deletions
Loading

.github/badges/jacoco.svg

Lines changed: 1 addition & 0 deletions
Loading

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
11
# java-smpte-timecode
2+
A minimalist java library for dealing with SMPTE timecodes. Supports all major broadcast timecodes.
3+
24
![Coverage](.github/badges/jacoco.svg)
5+
6+
7+
# Usage:
8+
9+
Create an immutable [TimecodeRecord](https://github.com/moormanm/java-smpte-timecode/blob/master/src/main/java/org/moormanity/smpte/timecode/TimecodeRecord.java) from a string and framerate:
10+
11+
```
12+
TimecodeRecord timecode = TimecodeOperations.fromTimecodeString("01:00:00;99", FrameRate._29_97_drop));
13+
```
14+
15+
All supported framerates are in the [FrameRate.java](https://github.com/moormanm/java-smpte-timecode/blob/master/src/main/java/org/moormanity/smpte/timecode/FrameRate.java) enum.
16+
17+
Create an immutable TimecodeRecord from an elapsed frame count and framerate:
18+
```
19+
TimecodeOperations.fromElapsedFrames(10044, FrameRate._25);
20+
```
21+
22+
Subtract or add timecodes to create new ones:
23+
```
24+
TimecodeRecord a = TimecodeOperations.fromTimecodeString("23:30:00;00", FrameRate._29_97_drop);
25+
TimecodeRecord b = TimecodeOperations.fromTimecodeString("01:00:00;00", FrameRate._29_97_drop);
26+
TimecodeRecord aMinusB = TimecodeOperations.subtract(a,b);
27+
28+
TimecodeRecord a = TimecodeOperations.fromTimecodeString("23:30:00;00", FrameRate._29_97_drop);
29+
TimecodeRecord b = TimecodeOperations.fromTimecodeString("01:00:00;00", FrameRate._29_97_drop);
30+
TimecodeRecord aPlusB = TimecodeOperations.add(a,b);
31+
```
32+
33+
Get the total elapsed frames of a TimecodeRecord:
34+
```
35+
TimecodeRecord a = TimecodeOperations.fromTimecodeString("23:30:00;00", FrameRate._29_97_drop);
36+
int totalElapsedFrames = TimecodeOperations.toElapsedFrameCount(a);
37+
```
38+
39+
Format a TimecodeRecord as a string:
40+
```
41+
TimecodeRecord a = TimecodeOperations.fromTimecodeString("23:30:00;00", FrameRate._29_97_drop);
42+
String timecodeString = TimecodeOperations.toTimecodeString(a);
43+
```
44+
45+
46+
## Supported Timecode Frame Rates
47+
48+
| Film / ATSC / HD | PAL / SECAM / DVB / ATSC | NTSC / ATSC / PAL-M | NTSC Non-Standard | ATSC |
49+
| ---------------- | ------------------------ | ------------------- | ----------------- | ---- |
50+
| 23.976 | 25 | 29.97 | 30 DF | 30 |
51+
| 24 | 50 | 29.97 DF | 60 DF | 60 |
52+
| 24.98 | 100 | 59.94 | 120 DF | 120 |
53+
| 47.952 | | 59.94 DF | | |
54+
| 48 | | 119.88 | | |
55+
| | | 119.88 DF | | |
56+
57+
58+

0 commit comments

Comments
 (0)