ffprobe

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 6 Imported by: 1

README

GoDoc

ffprobe for Go

Tool to probe & read media files using ffmpeg.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Streams []*Stream `json:"streams"`
	Format  *Format   `json:"format"`
	// contains filtered or unexported fields
}

func Probe

func Probe(fn string) (*File, error)

type Format

type Format struct {
	Filename       string            `json:"filename"`
	FormatName     string            `json:"format_name"`       // mov,mp4,m4a,3gp,3g2,mj2
	FormatLongName string            `json:"format_long_name"`  // QuickTime / MOV
	StartTime      float64           `json:"start_time,string"` // "start_time": "0.000000",
	Duration       float64           `json:"duration,string"`   // "duration": "240.048000",
	Size           int64             `json:"size,string"`       // "size": "73087904",
	BitRate        int               `json:"bit_rate,string"`   // "bit_rate": "2435776",
	Tags           map[string]string `json:"tags"`
}

type FrameRate

type FrameRate string // typically: 25/1 or 30000/1001

func (FrameRate) Value

func (f FrameRate) Value() float64

Value returns the float value for the given framerate, or math.NaN() if the value could not be parsed

type Stream

type Stream struct {
	Index          int       `json:"index"` // stream index
	CodecName      string    `json:"codec_name"`
	CodecLongName  string    `json:"codec_long_name"`
	Profile        string    `json:"profile"`
	CodecType      string    `json:"codec_type"`       // video
	CodecTagString string    `json:"codec_tag_string"` // avc1
	CodecTag       string    `json:"codec_tag"`        // 0x31637661
	Width          int       `json:"width,omitempty"`
	Height         int       `json:"height,omitempty"`
	CodedWidth     int       `json:"coded_width"`
	CodedHeight    int       `json:"coded_height"`
	ClosedCaptions int       `json:"closed_captions"`
	FrameRate      FrameRate `json:"r_frame_rate"`
	SampleRate     int       `json:"sample_rate,string"`
	Duration       float64   `json:"duration,string"`
	StartTime      float64   `json:"start_time,string"`
	StartPTS       int       `json:"start_pts"`

	Disposition *struct {
		Default int `json:"default"`
		Dub     int `json:"dub"`
	} `json:"disposition,omitempty"`

	Tags map[string]string `json:"tags"`
}

Jump to

Keyboard shortcuts

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