timecode

package module
v0.0.0-...-93c59d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 4 Imported by: 0

README

timecode-go

Golang timecode Library

Installing

go get -u github.com/tsujimic/timecode-go

Using the timeocode-go

package main

import (
	"fmt"
	"github.com/tsujimic/timecode-go"
)

func main() {
	var v int
	var r string
	var err error
	v, err = timecode.ParseInt("00:58:30.10", timecode.SMPTE2997DROP)
	r = timecode.FormatString(v, timecode.SMPTE2997DROP)
	v, err = timecode.ParseDuration("00:58:30.10", "01:00:00.00", timecode.SMPTE2997DROP)
}

Documentation

Index

Constants

View Source
const (
	// SMPTE2398 23.98 frame rate. Also known as Film Sync.
	SMPTE2398 = iota
	// SMPTE24 24 fps frame rate.
	SMPTE24
	// SMPTE25 25 fps frame rate. Also known as PAL.
	SMPTE25
	// SMPTE2997DROP 29.97 fps Drop Frame timecode. Used in the NTSC television system.
	SMPTE2997DROP
	// SMPTE2997NONDROP 29.97 fps Non Drop Fram timecode. Used in the NTSC television system.
	SMPTE2997NONDROP
	// SMPTE30 30 fps frame rate.
	SMPTE30
)

Variables

This section is empty.

Functions

func FormatString

func FormatString(framecount int, frameRate FrameRate) string

FormatString ...

func IsValid

func IsValid(s string) bool

IsValid ...

func ParseDuration

func ParseDuration(in, out string, frameRate FrameRate) (int, error)

ParseDuration ...

func ParseInt

func ParseInt(s string, frameRate FrameRate) (int, error)

ParseInt ...

Types

type FrameRate

type FrameRate int

FrameRate ...

func (FrameRate) String

func (fr FrameRate) String() string

type TimeCode

type TimeCode struct {
	// contains filtered or unexported fields
}

TimeCode ...

func ParseTimeCode

func ParseTimeCode(s string, frameRate FrameRate) (*TimeCode, error)

ParseTimeCode ...

func (*TimeCode) GetFrames

func (tm *TimeCode) GetFrames() int

GetFrames ...

func (*TimeCode) GetHours

func (tm *TimeCode) GetHours() int

GetHours ...

func (*TimeCode) GetMinutes

func (tm *TimeCode) GetMinutes() int

GetMinutes ...

func (*TimeCode) GetSeconds

func (tm *TimeCode) GetSeconds() int

GetSeconds ...

func (*TimeCode) IsValid

func (tm *TimeCode) IsValid(frameRate FrameRate) bool

IsValid ...

func (*TimeCode) IsValidSmpte24

func (tm *TimeCode) IsValidSmpte24() bool

IsValidSmpte24 ...

func (*TimeCode) IsValidSmpte25

func (tm *TimeCode) IsValidSmpte25() bool

IsValidSmpte25 ...

func (*TimeCode) IsValidSmpte30

func (tm *TimeCode) IsValidSmpte30() bool

IsValidSmpte30 ...

func (*TimeCode) IsValidSmpte2398

func (tm *TimeCode) IsValidSmpte2398() bool

IsValidSmpte2398 ...

func (*TimeCode) IsValidSmpte2997Drop

func (tm *TimeCode) IsValidSmpte2997Drop() bool

IsValidSmpte2997Drop ...

func (*TimeCode) IsValidSmpte2997NonDrop

func (tm *TimeCode) IsValidSmpte2997NonDrop() bool

IsValidSmpte2997NonDrop ...

func (*TimeCode) ParseIntSmpte24

func (tm *TimeCode) ParseIntSmpte24() int

ParseIntSmpte24 ...

func (*TimeCode) ParseIntSmpte25

func (tm *TimeCode) ParseIntSmpte25() int

ParseIntSmpte25 ...

func (*TimeCode) ParseIntSmpte30

func (tm *TimeCode) ParseIntSmpte30() int

ParseIntSmpte30 ...

func (*TimeCode) ParseIntSmpte2398

func (tm *TimeCode) ParseIntSmpte2398() int

ParseIntSmpte2398 ...

func (*TimeCode) ParseIntSmpte2997Drop

func (tm *TimeCode) ParseIntSmpte2997Drop() int

ParseIntSmpte2997Drop ...

func (*TimeCode) ParseIntSmpte2997NonDrop

func (tm *TimeCode) ParseIntSmpte2997NonDrop() int

ParseIntSmpte2997NonDrop ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL