ffmpeg

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAlbumArt

func ExtractAlbumArt(ctx context.Context, rd io.Reader) (*bytes.Buffer, error)

func UpdateMeta

func UpdateMeta(ctx context.Context, outPath string, params *UpdateMetadataParams, logger *zap.Logger) error

Types

type Format

type Format struct {
	Filename       string            `json:"filename"`
	NbStreams      int               `json:"nb_streams"`
	NbPrograms     int               `json:"nb_programs"`
	FormatName     string            `json:"format_name"`
	FormatLongName string            `json:"format_long_name"`
	StartTime      string            `json:"start_time"`
	Duration       string            `json:"duration"`
	BitRate        string            `json:"bit_rate"`
	ProbeScore     int               `json:"probe_score"`
	Tags           map[string]string `json:"tags"`
}

type ProbeDisposition

type ProbeDisposition struct {
	Default         int `json:"default"`
	Dub             int `json:"dub"`
	Original        int `json:"original"`
	Comment         int `json:"comment"`
	Lyrics          int `json:"lyrics"`
	Karaoke         int `json:"karaoke"`
	Forced          int `json:"forced"`
	HearingImpaired int `json:"hearing_impaired"`
	VisualImpaired  int `json:"visual_impaired"`
	CleanEffects    int `json:"clean_effects"`
	AttachedPic     int `json:"attached_pic"`
	TimedThumbnails int `json:"timed_thumbnails"`
	Captions        int `json:"captions"`
	Descriptions    int `json:"descriptions"`
	Metadata        int `json:"metadata"`
	Dependent       int `json:"dependent"`
	StillImage      int `json:"still_image"`
}

type Result

type Result struct {
	Format  *Format   `json:"format"`
	Streams []*Stream `json:"streams"`
}

func ProbeReader

func ProbeReader(ctx context.Context, rd io.Reader) (*Result, error)

func (*Result) GetAlbum

func (r *Result) GetAlbum() string

func (*Result) GetArtists

func (r *Result) GetArtists() []string

func (*Result) GetTitle

func (r *Result) GetTitle() string

func (*Result) HasAttachedPic

func (r *Result) HasAttachedPic() bool

func (*Result) HasMetadata

func (r *Result) HasMetadata() bool

type Stream

type Stream struct {
	Index          int               `json:"index"`
	CodecName      string            `json:"codec_name"`
	CodecLongName  string            `json:"codec_long_name"`
	CodecType      string            `json:"codec_type"`
	CodecTagString string            `json:"codec_tag_string"`
	CodecTag       string            `json:"codec_tag"`
	SampleFmt      string            `json:"sample_fmt"`
	SampleRate     string            `json:"sample_rate"`
	Channels       int               `json:"channels"`
	ChannelLayout  string            `json:"channel_layout"`
	BitsPerSample  int               `json:"bits_per_sample"`
	RFrameRate     string            `json:"r_frame_rate"`
	AvgFrameRate   string            `json:"avg_frame_rate"`
	TimeBase       string            `json:"time_base"`
	StartPts       int               `json:"start_pts"`
	StartTime      string            `json:"start_time"`
	BitRate        string            `json:"bit_rate"`
	Disposition    *ProbeDisposition `json:"disposition"`
	Tags           map[string]string `json:"tags"`
}

type UpdateMetadataParams

type UpdateMetadataParams struct {
	Audio    string // required
	AudioExt string // required

	Meta common.AudioMeta // required

	AlbumArt    []byte // optional
	AlbumArtExt string // required if AlbumArt is not nil
}

Jump to

Keyboard shortcuts

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