Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Rate_23_976 = Rate{"23.976", 24, 0, 24000, 1001} Rate_24 = Rate{"24", 24, 0, 24, 1} Rate_30 = Rate{"30", 30, 0, 30, 1} Rate_29_97 = Rate{"29.97", 30, 2, 30000, 1001} Rate_60 = Rate{"60", 60, 0, 60, 1} Rate_59_94 = Rate{"59.94", 60, 4, 60000, 1001} )
var TimecodeRegex = regexp.MustCompile(`^(\d\d)(:|;)(\d\d)(:|;)(\d\d)(:|;)(\d+)$`)
TimecodeRegex is the pattern for a valid SMPTE timecode
Functions ¶
This section is empty.
Types ¶
type Components ¶
type Components struct {
Hours, Minutes, Seconds, Frames int64
}
func (Components) Equals ¶
func (c Components) Equals(other Components) bool
type Frame ¶
type Frame int64
Frame type represents a specific frame index within some media content
type Framer ¶
type Framer interface {
Frame() int64
}
Framer defines the interface for something that can be converted into a specific frame index. Currently, this is limited only to Frame and Timecode
type Rate ¶
Rate represents a frame rate for a timecode
func RateFromFraction ¶ added in v1.2.0
RateFromFraction returns a Rate from a numerator and denominator.
type Timecode ¶
type Timecode struct {
// contains filtered or unexported fields
}
Timecode represents a timecode value, either as a duration or a specific point in time
func FromComponents ¶
func FromComponents(components Components, rate Rate, dropFrame bool) *Timecode
func MustParse ¶
MustParse parses a timecode from a string, and treats it using the provided frame rate value
func Parse ¶
Parse parses a timecode from a string, and treats it using the provided frame rate value
func (*Timecode) Components ¶
func (t *Timecode) Components() Components
Components gets the components of the timecode: hours, minutes, seconds, frames.