metadata

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFullScan

func DecodeFullScan(ctx context.Context, path string) (float64, error)

func DecodeQuickScan

func DecodeQuickScan(ctx context.Context, path string, scans []float64, scanDuration float64) float64

Types

type Chapter

type Chapter struct {
	ID        int               `json:"id"`
	StartTime string            `json:"start_time"`
	EndTime   string            `json:"end_time"`
	Tags      map[string]string `json:"tags"`
}

type FFProbeOutput

type FFProbeOutput struct {
	Streams  []Stream  `json:"streams"`
	Format   Format    `json:"format"`
	Chapters []Chapter `json:"chapters"`
}

type Format

type Format struct {
	Filename   string            `json:"filename"`
	Duration   string            `json:"duration"`
	Size       string            `json:"size"`
	BitRate    string            `json:"bit_rate"`
	FormatName string            `json:"format_name"`
	Tags       map[string]string `json:"tags"`
}

type MediaMetadata

type MediaMetadata struct {
	Media           db.UpsertMediaParams
	Captions        []db.InsertCaptionParams
	ContainerFormat *string // From ffprobe format_name, used for transcoding decisions
}

func Extract

func Extract(ctx context.Context, path string, scanSubtitles bool, extractText bool, ocr bool, ocrEngine string, speechRec bool, speechRecEngine string) (*MediaMetadata, error)

type Stream

type Stream struct {
	CodecType    string            `json:"codec_type"`
	CodecName    string            `json:"codec_name"`
	Profile      string            `json:"profile"`
	PixFmt       string            `json:"pix_fmt"`
	Width        int               `json:"width"`
	Height       int               `json:"height"`
	AvgFrameRate string            `json:"avg_frame_rate"`
	RFrameRate   string            `json:"r_frame_rate"`
	SampleRate   string            `json:"sample_rate"`
	Channels     int               `json:"channels"`
	Duration     string            `json:"duration"`
	Tags         map[string]string `json:"tags"`
	Disposition  map[string]int    `json:"disposition"`
}

Jump to

Keyboard shortcuts

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