schema

package
v1.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artwork

type Artwork []byte

Artwork represents embedded artwork (cover art, thumbnails, etc.) as raw bytes. When JSON encoded, it is represented as a base64 string.

type AudioChannel

type AudioChannel struct {
	Index       int    `json:"index"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

func (AudioChannel) String

func (r AudioChannel) String() string

type AudioChannelLayout

type AudioChannelLayout struct {
	Name        string         `json:"name"`
	NumChannels int            `json:"num_channels"`
	Order       string         `json:"order"`
	Channels    []AudioChannel `json:"channels"`
}

func NewAudioChannelLayout

func NewAudioChannelLayout(ch *ff.AVChannelLayout) *AudioChannelLayout

func (AudioChannelLayout) String

func (r AudioChannelLayout) String() string

type Codec

type Codec struct {
	Name         string   `json:"name"`
	LongName     string   `json:"long_name,omitempty"`
	Type         string   `json:"type"`                      // "video", "audio", "subtitle", "data", "attachment", "unknown"
	ID           string   `json:"id"`                        // Codec ID name
	IsEncoder    bool     `json:"is_encoder"`                // Is this an encoder
	IsDecoder    bool     `json:"is_decoder"`                // Is this a decoder
	IsHardware   bool     `json:"is_hardware,omitempty"`     // Is hardware accelerated
	IsExperiment bool     `json:"is_experimental,omitempty"` // Is experimental
	Capabilities []string `json:"capabilities,omitempty"`    // Capability flags

	// Supported formats (only populated for relevant codec types)
	PixelFormats   []string `json:"pixel_formats,omitempty"`   // Supported pixel formats (video)
	SampleFormats  []string `json:"sample_formats,omitempty"`  // Supported sample formats (audio)
	SampleRates    []int    `json:"sample_rates,omitempty"`    // Supported sample rates (audio)
	ChannelLayouts []string `json:"channel_layouts,omitempty"` // Supported channel layouts (audio)
	Profiles       []string `json:"profiles,omitempty"`        // Supported profiles
}

func NewCodec

func NewCodec(codec *ff.AVCodec) *Codec

func (Codec) String

func (r Codec) String() string

type Device

type Device struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	IsDefault   bool     `json:"is_default,omitempty"`
	MediaTypes  []string `json:"media_types,omitempty"` // "video", "audio", etc.
}

func NewDevice

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

func (Device) String

func (r Device) String() string

type Filter

type Filter struct {
	*ff.AVFilter
}

func NewFilter

func NewFilter(filter *ff.AVFilter) *Filter

func (Filter) MarshalJSON

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

func (Filter) String

func (r Filter) String() string

type Format

type Format struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	MimeTypes   []string `json:"mime_types,omitempty"`  // MIME types
	Extensions  []string `json:"extensions,omitempty"`  // File extensions
	IsInput     bool     `json:"is_input"`              // Is demuxer (input format)
	IsOutput    bool     `json:"is_output"`             // Is muxer (output format)
	IsDevice    bool     `json:"is_device,omitempty"`   // Is device format
	Flags       []string `json:"flags,omitempty"`       // Format flags
	MediaTypes  []string `json:"media_types,omitempty"` // Supported media types: "video", "audio", "subtitle"

	// Output format specific fields
	DefaultVideoCodec    string `json:"default_video_codec,omitempty"`
	DefaultAudioCodec    string `json:"default_audio_codec,omitempty"`
	DefaultSubtitleCodec string `json:"default_subtitle_codec,omitempty"`

	// Device specific fields
	Devices []Device `json:"devices,omitempty"` // Available devices (for device formats)
}

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)

AddMediaType adds a media type to the format if not already present

func (*Format) SetDevices

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

SetDevices adds device information to a format

func (Format) String

func (r Format) String() string

type ListAudioChannelLayoutRequest

type ListAudioChannelLayoutRequest struct {
	Name        string `json:"name"`
	NumChannels int    `json:"num_channels"`
}

type ListAudioChannelLayoutResponse

type ListAudioChannelLayoutResponse []AudioChannelLayout

type ListCodecRequest

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

type ListCodecResponse

type ListCodecResponse []Codec

type ListFilterRequest

type ListFilterRequest struct {
	Name string `json:"name"`
}

type ListFilterResponse

type ListFilterResponse []Filter

type ListFormatRequest

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

type ListFormatResponse

type ListFormatResponse []Format

type ListPixelFormatRequest

type ListPixelFormatRequest struct {
	Name      string `json:"name"`
	NumPlanes int    `json:"num_planes"`
}

type ListPixelFormatResponse

type ListPixelFormatResponse []PixelFormat

type ListSampleFormatRequest

type ListSampleFormatRequest struct {
	Name     string `json:"name"`
	IsPlanar *bool  `json:"is_planar,omitempty"` // Filter by planar/packed (nil = no filter)
}

type ListSampleFormatResponse

type ListSampleFormatResponse []SampleFormat

type Output

type Output struct {
	Output     string   `json:"output"  arg:""` // Output media file path
	OutputOpts []string `json:"opts,omitempty"` // Format-specific options (e.g., "movflags=+faststart")
}

type PixelFormat

type PixelFormat struct {
	Name          string `json:"name"`
	NumComponents int    `json:"num_components"`       // Number of components (1-4)
	NumPlanes     int    `json:"num_planes,omitempty"` // Number of planes
	BitsPerPixel  int    `json:"bits_per_pixel"`       // Bits per pixel
	IsPlanar      bool   `json:"is_planar"`            // Is planar format
	IsRGB         bool   `json:"is_rgb"`               // Is RGB-like format
	HasAlpha      bool   `json:"has_alpha"`            // Has alpha channel
	IsFloat       bool   `json:"is_float"`             // Is floating point format
	IsBigEndian   bool   `json:"is_big_endian"`        // Is big-endian format
	IsHWAccel     bool   `json:"is_hwaccel"`           // Is hardware accelerated
}

func NewPixelFormat

func NewPixelFormat(pixfmt ff.AVPixelFormat) *PixelFormat

func (PixelFormat) String

func (r PixelFormat) String() string

type ProbeRequest

type ProbeRequest struct {
	Request
	Metadata bool `json:"metadata,omitempty" help:"Include metadata in response"`
	Artwork  bool `json:"artwork,omitempty" help:"Include artwork in response"`
}

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
	Metadata    map[string]string `json:"metadata,omitempty"`    // Metadata key-value pairs
	Artwork     []Artwork         `json:"artwork,omitempty"`     // Artwork images as raw bytes (JSON encodes as base64)
}

func (ProbeResponse) String

func (r ProbeResponse) String() string

type RemuxRequest

type RemuxRequest struct {
	Request
	Output
	Streams      []int             `json:"streams,omitempty"`       // Stream indices to include (empty = all streams)
	CopyMetadata bool              `json:"copy_metadata,omitempty"` // Copy existing metadata from source
	CopyArtwork  bool              `json:"copy_artwork,omitempty"`  // Copy existing artwork from source
	Metadata     map[string]string `json:"metadata,omitempty"`      // Metadata to set (empty string value clears existing)
	Artwork      []Artwork         `json:"artwork,omitempty"`       // Artwork to add/replace
}

func (RemuxRequest) String

func (r RemuxRequest) String() string

type RemuxResponse

type RemuxResponse struct {
	Format   string            `json:"format"`             // Output format name
	Duration float64           `json:"duration"`           // Duration in seconds
	Size     int64             `json:"size"`               // Total bytes written
	Streams  []Stream          `json:"streams,omitempty"`  // Stream information
	Metadata map[string]string `json:"metadata,omitempty"` // Final metadata
	Artwork  []Artwork         `json:"artwork,omitempty"`  // Final artwork
}

func (RemuxResponse) String

func (r RemuxResponse) String() string

type Request

type Request struct {
	Input  string    `json:"input" arg:""` // Input media file path
	Reader io.Reader `json:"-" kong:"-"`   // Reader for media data
}

type SampleFormat

type SampleFormat struct {
	Name           string `json:"name"`
	BytesPerSample int    `json:"bytes_per_sample"` // Bytes per sample
	BitsPerSample  int    `json:"bits_per_sample"`  // Bits per sample
	IsPlanar       bool   `json:"is_planar"`        // Is planar format
	PackedName     string `json:"packed_name,omitempty"`
	PlanarName     string `json:"planar_name,omitempty"`
}

func NewSampleFormat

func NewSampleFormat(samplefmt ff.AVSampleFormat) *SampleFormat

func (SampleFormat) String

func (r SampleFormat) String() string

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream represents an AVStream from a media file

func NewStream

func NewStream(stream *ff.AVStream) *Stream

NewStream creates a Stream from an AVStream

func (*Stream) CodecPar

func (s *Stream) CodecPar() *ff.AVCodecParameters

Return the codec parameters

func (*Stream) Index

func (s *Stream) Index() int

Return the stream index

func (*Stream) IsAttachedPic

func (s *Stream) IsAttachedPic() bool

IsAttachedPic returns true if this stream is an attached picture (album art)

func (*Stream) IsDefault

func (s *Stream) IsDefault() bool

IsDefault returns true if this stream has the default disposition

func (*Stream) MarshalJSON

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

func (Stream) String

func (s Stream) String() string

func (*Stream) Type

func (s *Stream) Type() media.Type

Return the stream type

type Writer

type Writer interface {
	io.Writer
	Progress(current, total int64) // Report progress (units depends on task)
	Log(message string)            // Receive log messages
}

Writer is an optional interface that writers can implement to receive progress updates during long-running operations

Jump to

Keyboard shortcuts

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