schema

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioFingerprintLookupRequest

type AudioFingerprintLookupRequest struct {
	Fingerprint string   `json:"fingerprint"` // Audio fingerprint string
	Duration    float64  `json:"duration"`    // Track duration in seconds
	Metadata    []string ``                   // Metadata to request
	/* 148-byte string literal not displayed */
}

type AudioFingerprintLookupResponse

type AudioFingerprintLookupResponse struct {
	Matches [][]*chromaprintschema.ResponseMatch `json:"matches,omitempty"` // AcoustID matches
}

func (AudioFingerprintLookupResponse) String

type AudioFingerprintRequest

type AudioFingerprintRequest struct {
	Input       string    `json:"input,omitempty"` // Input media file path
	Reader      io.Reader `json:"-" kong:"-"`      // Reader for media data
	InputFormat string    `json:"input_format,omitempty" name:"input-format" help:"Input format name (e.g. s16le)"`
	InputOpts   []string  `json:"input_opts,omitempty" name:"input-opt" help:"Input format option key=value (repeatable)"`
	Duration    float64   `json:"duration,omitempty"` // Full track duration in seconds (0 = auto-detect)
}

type AudioFingerprintResponse

type AudioFingerprintResponse struct {
	Fingerprint string  `json:"fingerprint"` // Audio fingerprint string
	Duration    float64 `json:"duration"`    // Track duration in seconds
}

func (AudioFingerprintResponse) String

func (r AudioFingerprintResponse) String() string

type Codec

type Codec struct {
	*ff.AVCodec
	Opts []*ff.AVOption `json:"options,omitempty"`
}

func NewCodec

func NewCodec(codec *ff.AVCodec) *Codec

func (Codec) Cell

func (c Codec) Cell(col int) string

func (Codec) Header

func (Codec) Header() []string

func (Codec) MarshalJSON

func (r Codec) MarshalJSON() ([]byte, error)

func (Codec) Role

func (c Codec) Role() string

func (Codec) String

func (r Codec) String() string

func (*Codec) Type

func (c *Codec) Type() *MediaType

Type returns a MediaType wrapper that provides proper string formatting.

func (Codec) Width

func (Codec) Width(col int) int

type Device

type Device struct {
	Index       int      `json:"index"`
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	IsDefault   bool     `json:"is_default,omitempty"`
	MediaTypes  []string `json:"media_types,omitempty"`
}

func NewDevice

func NewDevice(info *ff.AVDeviceInfo, index int, isDefault bool) *Device

func (Device) Cell

func (d Device) Cell(col int) string

func (Device) Header

func (Device) Header() []string

func (Device) Media

func (d Device) Media() string

func (Device) String

func (r Device) String() string

func (Device) Width

func (Device) Width(col int) int

type Filter

type Filter struct {
	*ff.AVFilter
	Opts []*ff.AVOption `json:"options,omitempty"`
}

func NewFilter

func NewFilter(filter *ff.AVFilter) *Filter

func (Filter) Cell

func (f Filter) Cell(col int) string

func (Filter) Header

func (Filter) Header() []string

func (Filter) MarshalJSON

func (r Filter) MarshalJSON() ([]byte, error)

func (Filter) String

func (r Filter) String() string

func (Filter) Width

func (Filter) Width(col int) int

type Format

type Format struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	MimeTypes   []string `json:"mime_types,omitempty"`
	Extensions  []string `json:"extensions,omitempty"`
	IsInput     bool     `json:"is_input"`
	IsOutput    bool     `json:"is_output"`
	IsDevice    bool     `json:"is_device,omitempty"`
	Flags       []string `json:"flags,omitempty"`
	MediaTypes  []string `json:"media_types,omitempty"`

	DefaultVideoCodec    string `json:"default_video_codec,omitempty"`
	DefaultAudioCodec    string `json:"default_audio_codec,omitempty"`
	DefaultSubtitleCodec string `json:"default_subtitle_codec,omitempty"`

	Devices []Device       `json:"devices,omitempty"`
	Opts    []*ff.AVOption `json:"options,omitempty"`
}

func NewInputFormat

func NewInputFormat(input *ff.AVInputFormat, isDevice bool) *Format

func NewOutputFormat

func NewOutputFormat(output *ff.AVOutputFormat, isDevice bool) *Format

func (*Format) AddMediaType

func (f *Format) AddMediaType(mediaType string)

func (Format) Cell

func (f Format) Cell(col int) string

func (Format) Header

func (Format) Header() []string

func (Format) Kind

func (f Format) Kind() string

func (Format) Media

func (f Format) Media() string

func (*Format) SetDevices

func (f *Format) SetDevices(devices []Device)

func (Format) String

func (r Format) String() string

func (Format) Width

func (Format) Width(col int) int

type ListCodecRequest

type ListCodecRequest struct {
	Name      string `json:"name,omitempty" help:"Filter by codec name (partial match)"`
	Type      string `json:"type,omitempty" help:"Filter by media type: video, audio, subtitle, data"`
	IsEncoder *bool  `json:"is_encoder,omitempty" help:"Filter by encoder (true) or decoder (false)"`
}

type ListCodecResponse

type ListCodecResponse []Codec

func (ListCodecResponse) String

func (r ListCodecResponse) String() string

type ListFilterRequest

type ListFilterRequest struct {
	Name string `json:"name" help:"Filter by filter name (partial match)"`
}

type ListFilterResponse

type ListFilterResponse []Filter

func (ListFilterResponse) String

func (r ListFilterResponse) String() string

type ListFormatRequest

type ListFormatRequest struct {
	Name     string `json:"name,omitempty" help:"Filter by format name (partial match)"`
	IsInput  *bool  `json:"is_input,omitempty" help:"Filter by input format (demuxer)"`
	IsOutput *bool  `json:"is_output,omitempty" help:"Filter by output format (muxer)"`
	IsDevice *bool  `json:"is_device,omitempty" help:"Filter by device format"`
}

type ListFormatResponse

type ListFormatResponse []Format

func (ListFormatResponse) String

func (r ListFormatResponse) String() string

type MediaType

type MediaType ff.AVMediaType

func (*MediaType) Equals

func (mt *MediaType) Equals(t ff.AVMediaType) bool

Equals checks if the MediaType equals the given AVMediaType.

func (MediaType) MarshalJSON

func (mt MediaType) MarshalJSON() ([]byte, error)

func (MediaType) String

func (mt MediaType) String() string

type Meta

type Meta struct {
	Name        string     `json:"name,omitempty" yaml:"name,omitempty"`
	ContentType string     `json:"content_type,omitempty" yaml:"content_type,omitempty"`
	Meta        []MetaItem `json:"meta,omitempty" yaml:"meta,omitempty"`
}

type MetaItem

type MetaItem struct {
	Name             string `json:"name,omitempty" yaml:"name,omitempty"`
	MetaKey          string `json:"key,omitempty" yaml:"key,omitempty"`
	MetaValue        any    `json:"value,omitempty" yaml:"value,omitempty"`
	gomedia.Metadata `json:"-" yaml:"-"`
}

func (MetaItem) Any

func (m MetaItem) Any() any

func (MetaItem) Cell

func (r MetaItem) Cell(col int) string

func (MetaItem) Header

func (MetaItem) Header() []string

func (MetaItem) Key

func (m MetaItem) Key() string

func (MetaItem) MarshalJSON

func (m MetaItem) MarshalJSON() ([]byte, error)

func (MetaItem) MarshalYAML

func (m MetaItem) MarshalYAML() (any, error)

func (MetaItem) Width

func (MetaItem) Width(col int) int

type ProbeRequest

type ProbeRequest struct {
	Reader      io.Reader `json:"-" kong:"-"` // Reader for media data
	InputFormat string    `json:"input_format,omitempty" name:"input-format" help:"Input format name (e.g. mpegts)"`
	InputOpts   []string  `json:"input_opts,omitempty" name:"input-opt" help:"Input format option key=value (repeatable)"`
}

type ProbeResponse

type ProbeResponse struct {
	Format      string    `json:"format"`                // Format name (e.g., "mov,mp4,m4a,3gp,3g2,mj2")
	Description string    `json:"description,omitempty"` // Format description (e.g., "QuickTime / MOV")
	MimeTypes   []string  `json:"mime_types,omitempty"`  // MIME types
	Duration    float64   `json:"duration"`              // Duration in seconds
	Streams     []*Stream `json:"streams,omitempty"`     // Stream information
}

func (ProbeResponse) String

func (r ProbeResponse) String() string

type SegmentAudioRequest

type SegmentAudioRequest struct {
	Reader           io.Reader     `json:"-" kong:"-"`
	OutputDir        string        `json:"output_dir,omitempty" name:"out" help:"Output directory for encoded segment M4A files."`
	Duration         time.Duration `json:"duration,omitempty" name:"duration" help:"Target segment duration (e.g. 30s). Use 0s to disable fixed-size splits."`
	Silence          bool          `json:"silence" name:"silence" help:"Enable silence-based segmentation." negatable:"" default:"true"`
	SilenceDuration  time.Duration `` /* 168-byte string literal not displayed */
	SilenceThreshold float64       `` /* 172-byte string literal not displayed */
}

type Source

type Source interface {
	// Streams describes each stream's raw format, in the same order
	// Encoder.Add / Writer.Create expect — stream ID equals slice index. A
	// source's own Profile typically resolves to a raw codec (pcm_f32le,
	// rawvideo, ...) rather than a compressed one.
	Streams() []profile.Profile

	// NextFrame blocks until the next frame is ready, ctx is cancelled, or
	// the source has no more frames (io.EOF). Frames are paced by the
	// source itself — callers just pull in a loop.
	NextFrame(ctx context.Context) (frame.Frame, error)

	// Close releases resources the source holds (file handles, devices, ...).
	Close() error
}

Source produces frames for one or more streams until ctx is cancelled or the source naturally ends. It is the abstract input side of an encoding job — a live capture, a file, or a fallback generator like a test card — so a job can be built once and swap sources without restarting the encoder.

type Stream

type Stream struct {
	*ffschema.Stream
}

Stream wraps pkg/ffmpeg/schema Stream and adds CLI table formatting helpers.

func WrapStream

func WrapStream(s *ffschema.Stream) *Stream

func (Stream) Cell

func (s Stream) Cell(col int) string

func (Stream) Details

func (s Stream) Details() string

func (Stream) Header

func (Stream) Header() []string

func (Stream) MarshalJSON

func (s Stream) MarshalJSON() ([]byte, error)

func (Stream) String

func (s Stream) String() string

func (Stream) Width

func (Stream) Width(col int) int

Jump to

Keyboard shortcuts

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