ffprobe

package
v0.0.0-...-48889b8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (*ffprobe, error)

Types

type Data

type Data struct {
	Streams []*Stream `json:"streams"`
	Format  *Format   `json:"format"`
}

type Ffprober

type Ffprober interface {
	GetData(filePath string) (*Data, error)
	EmbeddedImage() (int, int, bool)
}

type Format

type Format struct {
	Filename       string  `json:"filename"`
	NumStreams     int     `json:"nb_streams"`
	NumPrograms    int     `json:"nb_programs"`
	FormatName     string  `json:"format_name"`
	FormatLongName string  `json:"format_long_name"`
	StartTime      float64 `json:"start_time,string"`
	Duration       float64 `json:"duration,string"`
	Size           string  `json:"size"`
	BitRate        string  `json:"bit_rate"`
	Score          int     `json:"probe_score"`
	Tags           *Tags   `json:"tags"`
}

type MockFfprobe

type MockFfprobe struct {
	Width    int
	Embedded string
}

func (*MockFfprobe) EmbeddedImage

func (m *MockFfprobe) EmbeddedImage() (int, int, bool)

func (*MockFfprobe) GetData

func (m *MockFfprobe) GetData(filePath string) (*Data, error)

type Stream

type Stream struct {
	// common
	Index          int    `json:"index"`
	CodecName      string `json:"codec_name"`
	CodecLongName  string `json:"codec_long_name"`
	CodecType      string `json:"codec_type"`
	CodecTimeBase  string `json:"codec_time_base"`
	CodecTagString string `json:"codec_tag_string"`
	CodecTag       string `json:"codec_tag"`
	// audio
	Channels      int    `json:"channels"`
	ChannelLayout string `json:"channel_layout"`
	SampleFmt     string `json:"sample_fmt"`
	SampleRate    string `json:"sample_rate"`
	TimeBase      string `json:"time_base"`
	StartPts      int    `json:"start_pts"`
	StartTime     string `json:"start_time"`
	DurationTs    uint64 `json:"duration_ts"`
	Duration      string `json:"duration"`
	// audio MP3
	BitRate string `json:"bit_rate"`
	// audio FLAC
	BitsPerRawSample string `json:"bits_per_raw_sample"`
	// image
	Width  int    `json:"width"`
	Height int    `json:"height"`
	PixFmt string `json:"pix_fmt"`
}

type Tags

type Tags struct {
	Album      string `json:"album"`
	Artist     string `json:"artist"`
	Comment    string `json:"comment"`
	Date       string `json:"date"`
	Genre      string `json:"genre"`
	Disc       string `json:"disc"`
	DiscTotal  string `json:"disctotal"`
	Encoder    string `json:"encoder"`
	Title      string `json:"title"`
	Track      string `json:"track"`
	TrackTotal string `json:"tracktotal"`
}

Jump to

Keyboard shortcuts

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