Documentation
¶
Overview ¶
Package ffmsindex provides a native Go library for parsing FFMS2 Indexes, for versions post-2.23.
Index ¶
Constants ¶
const ( TypeAudio = TrackType(1) TypeVideo = TrackType(0) )
Track types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct {
PTS int64
OriginalPTS int64
FilePos int64
SampleStart int64
SampleCount uint32
OriginalPos uint64
PosInDecodingOrder uint64
FrameType int
RepeatPict int32
SecondField bool
KeyFrame bool
MarkedHidden bool
}
Frame contains all info about a particular frame or sample.
type Header ¶
type Header struct {
ID uint32
Version struct {
Major uint8
Minor uint8
Micro uint8
Bump uint8
}
IndexVersion uint16
Tracks uint32
ErrorHandling uint32
AVUtilVersion struct {
Major uint8
Minor uint8
Micro uint8
}
AVFormatVersion struct {
Major uint8
Minor uint8
Micro uint8
}
AVCodecVersion struct {
Major uint8
Minor uint8
Micro uint8
}
SWScaleVersion struct {
Major uint8
Minor uint8
Micro uint8
}
FileSize int64
Digest [20]byte
LAVFOpts []LAVFOption
}
Header is the FFIndex header. It contains info on what versions of various libraries the index was generated with, and some other misc info about how it was generated.
type LAVFOption ¶
LAVFOption is a single key-value pair for a LAVF option.
type Track ¶
type Track struct {
TrackType TrackType
TimeBase struct {
Num int64
Den int64
}
LastDuration int64
MaxBFrames int32
UseDTS bool
HasTS bool
HasDiscontTS bool
Frames []Frame
// contains filtered or unexported fields
}
Track contains all info about a particular track, and all of its frames.
func (*Track) GetKeyframeIndices ¶
GetKeyframeIndicies gets a list of indicies that can be used in a given Track's frame slice. This differs from GetKeyframes in that it takes into account all frames, and not only visible frames. GetKeyframes would be more suitable, to, for example, use for seeking with FFMS2's API, or measuring keyframe distances.
func (*Track) GetKeyframes ¶
GetKeyframes gets a list of visible frame numbers which are keyframes. This frame number will differ from the frame number in the Frames slice, since some codecs, such as VP8, have hidden frames. This function takes those into account when calculating the frame numbers.
func (*Track) GetTimestamps ¶
GetTimestamps returns a list of timestamps for visible frames. The number of timestamps may differ from the length of the Frames slice, since some codecs, such as VP8, have hidden frames. This function takes those into account.