schema

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 5 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 AudioChannelLayout

type AudioChannelLayout struct {
	*ff.AVChannelLayout
}

func NewAudioChannelLayout

func NewAudioChannelLayout(ch *ff.AVChannelLayout) *AudioChannelLayout

func (AudioChannelLayout) MarshalJSON added in v1.8.1

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

func (AudioChannelLayout) String

func (r AudioChannelLayout) String() string

type Codec

type Codec struct {
	*ff.AVCodec
}

func NewCodec

func NewCodec(codec *ff.AVCodec) *Codec

func (Codec) MarshalJSON added in v1.8.1

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

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

type DecodeRequest added in v1.8.1

type DecodeRequest struct {
	Request // Embed base request (Input, Reader)
}

DecodeRequest specifies parameters for decoding media.

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"` // "video", "audio", etc.
}

func NewDevice

func NewDevice(info *ff.AVDeviceInfo, index int, 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 FrameWriter added in v1.8.1

type FrameWriter interface {
	io.Writer
	WriteFrame(streamIndex int, frame interface{}) error
}

FrameWriter is an optional interface that writers can implement to receive decoded frames directly instead of JSON output

type ListAudioChannelLayoutRequest

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

type ListAudioChannelLayoutResponse

type ListAudioChannelLayoutResponse []AudioChannelLayout

func (ListAudioChannelLayoutResponse) String added in v1.8.1

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

func (ListCodecResponse) String added in v1.8.1

func (r ListCodecResponse) String() string

type ListFilterRequest

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

type ListFilterResponse

type ListFilterResponse []Filter

func (ListFilterResponse) String added in v1.8.1

func (r ListFilterResponse) String() string

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

func (ListFormatResponse) String added in v1.8.1

func (r ListFormatResponse) String() string

type ListPixelFormatRequest

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

type ListPixelFormatResponse

type ListPixelFormatResponse []PixelFormat

func (ListPixelFormatResponse) String added in v1.8.1

func (r ListPixelFormatResponse) String() string

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

func (ListSampleFormatResponse) String added in v1.8.1

func (r ListSampleFormatResponse) String() string

type MediaType added in v1.8.1

type MediaType ff.AVMediaType

func (*MediaType) Equals added in v1.8.1

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

Equals checks if the MediaType equals the given AVMediaType

func (MediaType) MarshalJSON added in v1.8.1

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

func (MediaType) String added in v1.8.1

func (mt MediaType) String() string

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 Packet added in v1.8.1

type Packet struct {
	*ff.AVPacket
}

func NewPacket added in v1.8.1

func NewPacket(pkt *ff.AVPacket) *Packet

func (*Packet) MarshalJSON added in v1.8.1

func (p *Packet) MarshalJSON() ([]byte, error)

func (*Packet) String added in v1.8.1

func (p *Packet) String() string

func (*Packet) Ts added in v1.8.1

func (p *Packet) Ts() float64

Ts returns the timestamp in seconds, or -1.0 if the timestamp is undefined or timebase is not set

type PixelFormat

type PixelFormat struct {
	ff.AVPixelFormat
}

func NewPixelFormat

func NewPixelFormat(pixfmt ff.AVPixelFormat) *PixelFormat

func (PixelFormat) MarshalJSON added in v1.8.1

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

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
	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 SampleFormat

type SampleFormat struct {
	ff.AVSampleFormat
}

func NewSampleFormat

func NewSampleFormat(samplefmt ff.AVSampleFormat) *SampleFormat

func (SampleFormat) MarshalJSON added in v1.8.1

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

func (SampleFormat) String

func (r SampleFormat) String() string

type Stream

type Stream struct {
	*ff.AVStream
	// contains filtered or unexported fields
}

Stream represents a thin wrapper around AVStream

func NewStream

func NewStream(stream *ff.AVStream) *Stream

NewStream creates a Stream from an AVStream

func (*Stream) CodecPar

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

CodecPar returns the codec parameters for this stream

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

Type returns the media type of this stream

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