mediainfo

package module
v0.0.0-...-cdb2740 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 4 Imported by: 0

README

go-mediainfo

GoDoc Build Status

Go wrapper of the mediainfo library.

cmd/howtouse/howtouse.go shows a brief example of most of the functions. The MediaInfo library is a bit unconventional in its design and somewhat poorly documented. Unlike the official wrappers there are a few liberties with naming taken to make the library more idiomatic Go.

Documentation

Index

Constants

View Source
const (
	// StreamGeneral is a for general container stream.
	StreamGeneral StreamKind = 0
	// StreamVideo is a video stream.
	StreamVideo = 1
	// StreamAudio is an audio stream.
	StreamAudio = 2
	// StreamText is embedded text (subtitles) stream.
	StreamText = 3
	// StreamOther is for chapters.
	StreamOther = 4
	// StreamImage is for embedded images.
	StreamImage = 5
	// StreamMenu is for dynamic menus.
	StreamMenu = 6
)
View Source
const (
	// InfoName is the unique name of parameter.
	InfoName InfoKind = 0
	// InfoText is value of parameter.
	InfoText = 1
	// InfoMeasure is the unique name of measure unit of parameter.
	InfoMeasure = 2
	InfoOptions = 3
	// InfoNameText is translated name of parameter.
	InfoNameText = 4
	// InfoMeasureText is translated name of measure unit.
	InfoMeasureText = 5
	// InfoInfo is more information about the parameter.
	InfoInfo = 6
	// InfoHowTo is how this parameter is supported, could be N (No), B (Beta), R (Read only), W (Read/write).
	InfoHowTo = 7
)

Variables

View Source
var ErrOpenFailed = errors.New("file open failed")

ErrOpenFailed is returned by Open when mediainfo cannot open the file.

Functions

This section is empty.

Types

type InfoKind

type InfoKind int

InfoKind is used to specify the aspect of information (name, value, unit of measure) when retrieving information.

type MediaInfo

type MediaInfo struct {
	// contains filtered or unexported fields
}

MediaInfo is an instance of a mediainfo accessor.

func New

func New() *MediaInfo

New initializes a MediaInfo handle.

func (*MediaInfo) Close

func (mi *MediaInfo) Close()

Close closes the handle, releasing internal resources.

func (*MediaInfo) Count

func (mi *MediaInfo) Count(streamKind StreamKind) int

Count gets the number of a particular kind of stream in the file.

func (*MediaInfo) Get

func (mi *MediaInfo) Get(streamKind StreamKind, streamNumber int, parameter string) string

Get gets a textual file metadata item according to the parameters.

func (*MediaInfo) GetI

func (mi *MediaInfo) GetI(streamKind StreamKind, streamNumber int, parameter int, kindOfInfo InfoKind) string

GetI gets the file info at a particular parameter index.

func (*MediaInfo) GetKind

func (mi *MediaInfo) GetKind(streamKind StreamKind, streamNumber int, parameter string, kindOfInfo InfoKind) string

GetKind gets file metadata according to the parameters.

func (*MediaInfo) Inform

func (mi *MediaInfo) Inform() string

Inform gets the file info (if available) according to previous options set by Option

func (*MediaInfo) Open

func (mi *MediaInfo) Open(path string) error

Open opens the file at path with the mediainfo library.

func (*MediaInfo) Option

func (mi *MediaInfo) Option(option string) string

Option gets a MediaInfo handle option

func (*MediaInfo) SetOption

func (mi *MediaInfo) SetOption(option, value string) string

SetOption sets a MediaInfo handle option

type StreamKind

type StreamKind int

StreamKind is used to specify the type of stream (audio, video, chapters, etc) when getting information.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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