media

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AudioStream string = "audio"

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format struct {
	Path           string `json:"filename"`
	FormatName     string `json:"format_name"`
	FormatLongName string `json:"format_long_name"`
	Tags           Tags
	Streams        int     `json:"nb_streams"`
	StartTime      float64 `json:"start_time,string"`
	Duration       float64 `json:",string"`
	Size           int     `json:",string"`
	BitRate        int     `json:"bit_rate,string"`
	Score          int     `json:"probe_score"`
}

type Probe

type Probe struct {
	Streams []Stream
	Format  Format
}

func (*Probe) FullPath added in v0.4.1

func (pr *Probe) FullPath() string

func (*Probe) FullTags

func (pr *Probe) FullTags(preferred string, acceptable []string) *Tags

func (*Probe) GetAcceptableAudio

func (pr *Probe) GetAcceptableAudio(codecs []string) []Stream

func (*Probe) GetAudioCount

func (pr *Probe) GetAudioCount() int

func (*Probe) GetAudioStreams

func (pr *Probe) GetAudioStreams() []Stream

func (*Probe) GetFirstAcceptableAudio

func (pr *Probe) GetFirstAcceptableAudio(codecs []string) *Stream

func (*Probe) GetFirstAudio

func (pr *Probe) GetFirstAudio() *Stream

func (*Probe) GetFirstPreferredAudio

func (pr *Probe) GetFirstPreferredAudio(codec string) *Stream

func (*Probe) HasPath added in v0.4.1

func (pr *Probe) HasPath() bool

func (*Probe) ShortPath

func (pr *Probe) ShortPath() string

func (*Probe) Title

func (pr *Probe) Title(preferred string, acceptable []string) string

func (*Probe) WantedAudioStream

func (pr *Probe) WantedAudioStream(preferred string, acceptable []string) *Stream

type Stream

type Stream struct {
	CodecName     string `json:"codec_name"`
	CodecLongName string `json:"codec_long_name"`
	Profile       string
	CodecType     string `json:"codec_type"`
	CodecTag      string `json:"codec_tag_string"`
	Tags          Tags
	Index         int
	Width         int
	Height        int
	StartTime     float64 `json:"start_time,string"`
	Duration      float64 `json:",string"`
	DurationTs    int     `json:"duration_ts"`
}

func (*Stream) IsAcceptableCodec

func (st *Stream) IsAcceptableCodec(codecs []string) bool

func (*Stream) IsWantedCodec

func (st *Stream) IsWantedCodec(preferred string) bool

type Tags

type Tags struct {
	Title                     string
	Artist                    string
	AlbumArtist               string `json:"album_artist"`
	Album                     string
	Date                      string
	Comment                   string
	Description               string
	Synopsis                  string
	Url                       string `json:"purl"`
	ArtistSort                string
	AlbumArtistSort           string
	ReleaseCountry            string
	Label                     string
	Composer                  string
	Genre                     string
	DiscStr                   string    `json:"disc"`
	DiscTotal                 string    `json:"DISCTOTAL"`
	DiscTTotal                string    `json:"DISC_TOTAL"`
	TrackStr                  string    `json:"track"`
	TrackTotal                string    `json:"TRACKTOTAL"`
	TrackTTotal               string    `json:"TRACK_TOTAL"`
	Disc                      int       `json:"DISC_NUM"`
	DiscCount                 int       `json:"DISC_COUNT"`
	Track                     int       `json:"TRACK_NUM"`
	TrackCount                int       `json:"TRACK_COUNT"`
	AcoustidId                uuid.UUID `json:"ACOUSTID_ID"`
	MusicbrainzReleaseGroupId uuid.UUID `json:"MUSICBRAINZ_RELEASEGROUPID"`
	MusicbrainzAlbumId        uuid.UUID `json:"MUSICBRAINZ_ALBUMID"`
	MusicbrainzArtistId       uuid.UUID `json:"MUSICBRAINZ_ARTISTID"`
	MusicbrainzAlbumArtistId  uuid.UUID `json:"MUSICBRAINZ_ALBUMARTISTID"`
	MusicbrainzRecordingId    uuid.UUID `json:"MUSICBRAINZ_RECORDINGID"`
	MusicBrainzLabelId        uuid.UUID `json:"MUSICBRAINZ_LABELID"`
}

func (*Tags) CleanupTrackAndDisc added in v0.4.0

func (t *Tags) CleanupTrackAndDisc()

func (*Tags) MarshalObject

func (t *Tags) MarshalObject(e *log.Entry)

func (*Tags) Merge

func (t *Tags) Merge(ot *Tags)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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