media

package
v0.1.47 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutChapter

func CutChapter(media *Media, chapter *avtools.Chapter) ff.Cmd

func GenerateChapters

func GenerateChapters(media []*Media) []*avtools.Chapter

func Inc

func Inc(n int) int

func IsPlainText

func IsPlainText(mtype string) bool

Types

type Bool

type Bool struct {
	Meta     bool
	Cue      bool
	Cover    bool
	Chapters bool
}

type Cmd

type Cmd interface {
	Run() error
}

func ExtractCover

func ExtractCover(m *Media) Cmd

func Join

func Join(ext string, dir ...string) (Cmd, map[string]Cmd)

type Command

type Command struct {
	Flags
}

func (Command) CutChapter

func (cmd Command) CutChapter(input string, num int) Cmd

func (Command) CutStamp

func (cmd Command) CutStamp(input, start, end string) Cmd

func (Command) Extract

func (cmd Command) Extract(input string) []Cmd

func (Command) Remove

func (cmd Command) Remove(input string) Cmd

func (Command) Split

func (cmd Command) Split(input string) []Cmd

func (Command) Thumbnail

func (cmd Command) Thumbnail(input string, output string) Cmd

func (Command) Update

func (cmd Command) Update(input string) Cmd

type File

type File struct {
	*FileName
	Abs      string
	Base     string
	File     string
	Mimetype string
}

func NewFile

func NewFile(n string) File

func (File) IsCue

func (f File) IsCue() bool

func (File) IsFFMeta

func (f File) IsFFMeta() bool

func (File) IsImage

func (f File) IsImage() bool

func (File) NewName

func (f File) NewName() *FileName

type FileName

type FileName struct {
	Path    string
	Ext     string
	Name    string
	Padding string
	// contains filtered or unexported fields
}

func NewFileName

func NewFileName() *FileName

func (FileName) Join

func (f FileName) Join() string

func (*FileName) Pad

func (f *FileName) Pad(i int) *FileName

func (*FileName) Prefix

func (f *FileName) Prefix(pre string) *FileName

func (FileName) Run

func (f FileName) Run() error

func (*FileName) Save

func (f *FileName) Save(data []byte)

func (*FileName) Suffix

func (f *FileName) Suffix(suf string) *FileName

func (*FileName) Tmp

func (f *FileName) Tmp(data []byte)

func (*FileName) WithExt

func (f *FileName) WithExt(e string) *FileName

func (FileName) Write

func (f FileName) Write(wr io.Writer) error

type Files

type Files struct {
	Meta  string
	Cue   string
	Cover string
}

type Flags

type Flags struct {
	Bool    Bool
	File    Files
	Profile string
}

type Media

type Media struct {
	*avtools.Media

	Input       File
	Output      File
	Ini         File
	Cue         File
	Cover       File
	Profile     string
	HasCover    bool
	MetaChanged bool
	// contains filtered or unexported fields
}

func New

func New(input string) *Media

func (Media) AudioStreams

func (m Media) AudioStreams() []Stream

func (Media) Command

func (m Media) Command() ff.Cmd

func (Media) DumpCue

func (m Media) DumpCue() []byte

func (Media) DumpFFMeta

func (m Media) DumpFFMeta() *ff.Cmd

func (Media) DumpIni

func (m Media) DumpIni() []byte

func (Media) GetChapter

func (m Media) GetChapter(num int) *avtools.Chapter

func (Media) HasChapters

func (m Media) HasChapters() bool

func (Media) IsAudio

func (m Media) IsAudio() bool

func (Media) IsVideo

func (m Media) IsVideo() bool

func (*Media) LoadCue

func (m *Media) LoadCue(name string)

func (*Media) LoadIni

func (m *Media) LoadIni(name string)

func (*Media) LoadMeta

func (m *Media) LoadMeta(name string) *Media

func (*Media) Probe

func (m *Media) Probe() *Media

func (Media) SaveMetaFmt

func (m Media) SaveMetaFmt(f string) Cmd

func (Media) VideoStreams

func (m Media) VideoStreams() []Stream

type Stream

type Stream struct {
	CodecType string
	CodecName string
	Index     string
	IsCover   bool
}

type UpdateCmd

type UpdateCmd struct {
	*Media
}

func (UpdateCmd) Run

func (up UpdateCmd) Run() error

Jump to

Keyboard shortcuts

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