GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - RasmusBroborg/DotnetTimecode: Dotnet Timecode is a C# class library for working with SMPTE Timecodes defined by the Society of Motion Picture and Television Engineers in the SMPTE 12M specification.

BranchesTags
Open more actions menu

Latest commit

 

History

165 Commits
165 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
build
build
 
 
src/timecode
src/timecode
 
 
tests/timecode.test
tests/timecode.test
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
timecode.sln
timecode.sln
 
 

Repository files navigation

Image of a non drop frame timecode.

What is Dotnet Timecode?

CI NuGet Nuget CodeQL

Dotnet Timecode is a C# class library for working with SMPTE Timecodes defined by the Society of Motion Picture and Television Engineers in the SMPTE 12M specification.

The library allows the user to construct timecode objects, manipulate timecode values, and convert between the most common framerates, including drop frame framerates such as 29.97DF and 59.95DF.

How do I get started?

Get the latest nuget package using the dotnet CLI

dotnet add package DotnetTimecode

or using the Nuget Package Manager

Install-Package DotnetTimecode

Add a reference to the library, then simply construct your objects.

Examples:

using DotnetTimecode;
using DotnetTimecode.Enums;

ITimecode foo = new Timecode(Framerate.fps30);
ITimecode bar = new Timecode(10, 00, 00, 00, Framerate.fps59_94_DF);
ITimecode baz = new Timecode("10:00:00:00", Framerate.fps24);

foo.ToString() // "00:00:00:00"
bar.AddMinutes(-61).ToString(); // "08:59:00;00"
baz.ConvertFramerate(Framerate.fps25).ToString(); // "09:36:00:00"

Public endpoints

Constructors

Timecode(Enums.Framerate framerate);
Timecode(int hour, int minute, int second, int frame, Enums.Framerate framerate);
Timecode(string timecode, Enums.Framerate framerate);

Object methods

timecodeObj.AddHours(hours);
timecodeObj.AddMinutes(minutes);
timecodeObj.AddSeconds(seconds);
timecodeObj.AddFrames(frames);
timecodeObj.ConvertFramerate(targetFramerate);
string timecodeString = timecodeObj.ToString();
string subtitleTimecodeString = timecodeObj.ToSubtitleString();

Static methods

string timecodeString = Timecode.AddHours(timecodeString, hoursInteger);
string timecodeString = Timecode.AddMinutes(timecodeString, minutesInteger);
string timecodeString = Timecode.AddSeconds(timecodeString, secondsInteger);
string timecodeString = Timecode.AddFrames(timecodeString, framesInteger);
string timecodeString = Timecode.ConvertFramerate(timecodeString, originalFramerateEnum, targetFramerateEnum);
string timecodeString = Timecode.ConvertSMPTETimecodeToSubtitleTimecode(srtTimecodeString, framerateEnum);
string subtitleTimecodeString = Timecode.ConvertSubtitleTimecodeToSMPTETimecode(timecodeString, framerateEnum);

Object Properties

int hour = timecodeObj.Hour;
int minute = timecodeObj.Minute;
int second = timecodeObj.Second;
int frame = timecodeObj.Frame;
int totalFrames = timecodeObj.TotalFrames;
Enums.Framerate framerate = timecodeObj.Framerate;

Static Properties

string timecodeRegex = Timecode.TimecodeRegexPattern;
string subtitleTimecodeRegex = Timecode.SubtitleTimecodeRegexPattern;

Operator Overloading

ITimecode timecodeObj1 = new Timecode(10, 0, 0, 0, Enums.Framerate.fps23_976); // 10:00:00:00
ITimecode timecodeObj2 = new Timecode(1, 0, 0, 0, Enums.Framerate.fps23_976); // 01:00:00:00

timecodeObj1 + timecodeObj2;  // 11:00:00:00
timecodeObj1 - timecodeObj2;  // 09:00:00:00
timecodeObj1 < timecodeObj2;  // False
timecodeObj1 > timecodeObj2;  // True
timecodeObj1 <= timecodeObj2; // False
timecodeObj1 >= timecodeObj2; // True
timecodeObj1 == timecodeObj2; // False
timecodeObj1 != timecodeObj2; // True

Contributions

How to contribute to the project

See CONTRIBUTING.md and CODE_OF_CONDUCT.md for instructions on how to contribute to the project.

License

Dotnet Timecode is Copyright © 2022 Rasmus Broborg and other contributors under the MIT license.

About

Dotnet Timecode is a C# class library for working with SMPTE Timecodes defined by the Society of Motion Picture and Television Engineers in the SMPTE 12M specification.

Topics

csharpdotnetdotnet-corefilmhacktoberfestsmptesmpte-timecodetimecodevideo

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

9 stars

Watchers

2 watching

Forks

7 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.