Documentation
¶
Overview ¶
Package timecode formats and parses FFmpeg time durations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClock = FFmpegClock{}
DefaultClock is the FFmpeg duration clock.
View Source
var ErrInvalidTimecode = errors.New("invalid timecode")
ErrInvalidTimecode is returned when a timestamp string cannot be parsed.
Functions ¶
This section is empty.
Types ¶
type FFmpegClock ¶
type FFmpegClock struct{}
FFmpegClock is the FFmpeg time-duration clock.
type Timecode ¶
type Timecode struct {
// contains filtered or unexported fields
}
Timecode is a media timestamp.
func FromDuration ¶
FromDuration builds a timecode from a duration.
Parameters:
- d: Backing duration. Signed values are kept.
Returns:
- timecode: The timestamp.
func FromSeconds ¶
FromSeconds builds a timecode from a floating-point second count.
Parameters:
- seconds: Timestamp in seconds. Negative, NaN, and Inf become zero.
Returns:
- timecode: The timestamp, or a zero value when seconds is not finite.
func Parse ¶
Parse builds a timecode from an FFmpeg time-duration string.
Parameters:
- value: An FFmpeg time-duration string.
Returns:
- timecode: The parsed timestamp.
- err: Non-nil when value is not a valid duration.
func (Timecode) Duration ¶
Duration returns the backing duration.
Returns:
- duration: The stored time.Duration.
func (Timecode) HMS ¶
HMS renders HH:MM:SS, rounding to the nearest second.
Returns:
- clock: The timestamp as HH:MM:SS.
Click to show internal directories.
Click to hide internal directories.