https://github.com/octaviospain/timecodestring
Library that converts between frame counts and a timecode string representation. It also provides functions to perform addition and subtraction operations.
https://github.com/octaviospain/timecodestring
frame-count timecode
Last synced: about 1 year ago
JSON representation
Library that converts between frame counts and a timecode string representation. It also provides functions to perform addition and subtraction operations.
- Host: GitHub
- URL: https://github.com/octaviospain/timecodestring
- Owner: octaviospain
- License: apache-2.0
- Created: 2016-05-31T10:31:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-10T11:22:33.000Z (about 9 years ago)
- Last Synced: 2025-01-08T01:48:42.336Z (about 1 year ago)
- Topics: frame-count, timecode
- Language: Java
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# TimecodeString
[](https://travis-ci.org/octaviospain/TimecodeString)
[](https://codecov.io/gh/octaviospain/TimecodeString)
[](https://github.com/octaviospain/TimecodeString/blob/master/LICENSE.txt)
Library that converts between frame counts and a [timecode](https://en.wikipedia.org/wiki/SMPTE_timecode) string representation.
The library supports multiple frame rates including such as 24fps, 25fps, 30fps and DF30 (29.97fps). It also provides functions to
perform addition and subtraction operation between timecodes.
## Usage
You can use the TimecodeString library by two ways:
1. Instantiating the `TimecodeString.java` class in your java project
```java
String frameRate = "25fps";
String value = "01:20:59:24"
TimecodeString timecode = TimecodeString.of(frameRate, value);
String frameCount = timecode.getFrameCountString(); // = 121499
String fullTimecodeString = timecode.getFullTimecodeString(); // = 01:20:59:24
String frameRate = "25fps";
String value = "121499"
TimecodeString timecode = TimecodeString.of(frameRate, value);
String fullTimecodeString = timecode.getFullTimecodeString(); // = "01:20:59:24"
String frameCount = timecode.getFrameCountString(); // = 121499
```
2. Using it as a command line program with the packaged `.jar`
passing arguments to it (thanks to [docopt](https://github.com/docopt/docopt.java)) with the following usage:
```
Usage:
java -jar TimecodeString.jar
java -jar TimecodeString.jar [-o ]
Options:
-o = specify output file [default: output.txt]
```
Example with frame rate argument:
```
java -jar TimecodeString.jar 25fps 252
```
would print
```
00:00:00:05
```
Example With an input file formatted with the following format:
```
25fps 00:00:00:05
25fps 252
30DF 00:00:00;09
30DF 571
...
```
Example
```
java -jar TimecodeString.jar input.txt
```
would print
```
Timecode string conversion successfully dumped to /Users/octavio/Desktop/output.txt
```
and the output.txt file:
```
5
00:00:10:02
9
00:00:19;01
30
00:00:01:00
```
## To do
* Implement other Timecodes