ffmpeg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string, callback func(c, t time.Duration)) error

Run runs ffmpeg with given set of arguments, optional callback will be used to report progress (current duration, total duration). Callback total duration can be 0 if unable to automatically detect.

func Version

func Version() (string, error)

Version returns ffmpeg version in string form

Types

type Media

type Media struct {
	// Format common file format information.
	Format map[string]interface{} `json:"format"`

	// Streams item information structure.
	Streams []*Stream `json:"streams"`

	// Duration is duration of storage file in seconds.
	Duration float64

	// Size of file in bytes.
	Size uint64
}

Media describes file information.

func Probe

func Probe(filename string) (*Media, error)

Probe returns container and stream information from given file.

func (*Media) String

func (info *Media) String() string

Strings packs info into json.

type Stream

type Stream struct {
	Index         int               `json:"index"`
	Type          string            `json:"codec_type"`
	CodecName     string            `json:"codec_name"`
	CodecLongName string            `json:"codec_long_name"`
	Bitrate       string            `json:"bitRate"`
	Duration      float64           `json:"duration,string"`
	Width         int64             `json:"width"`
	Height        int64             `json:"height"`
	Tags          map[string]string `json:"tags,omitempty"`
}

Stream information about single stream.

func (*Stream) String

func (info *Stream) String() string

Strings packs info into json.

Jump to

Keyboard shortcuts

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