Documentation
¶
Index ¶
- type Artwork
- type AudioChannel
- type AudioChannelLayout
- type Codec
- type Device
- type Filter
- type Format
- type ListAudioChannelLayoutRequest
- type ListAudioChannelLayoutResponse
- type ListCodecRequest
- type ListCodecResponse
- type ListFilterRequest
- type ListFilterResponse
- type ListFormatRequest
- type ListFormatResponse
- type ListPixelFormatRequest
- type ListPixelFormatResponse
- type ListSampleFormatRequest
- type ListSampleFormatResponse
- type Output
- type PixelFormat
- type ProbeRequest
- type ProbeResponse
- type RemuxRequest
- type RemuxResponse
- type Request
- type SampleFormat
- type Stream
- type Writer
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
}
type Device ¶
type Filter ¶
func (Filter) MarshalJSON ¶
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 ¶
AddMediaType adds a media type to the format if not already present
func (*Format) SetDevices ¶
SetDevices adds device information to a format
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 ListPixelFormatResponse ¶
type ListPixelFormatResponse []PixelFormat
type ListSampleFormatRequest ¶
type ListSampleFormatResponse ¶
type ListSampleFormatResponse []SampleFormat
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 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 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 (*Stream) CodecPar ¶
func (s *Stream) CodecPar() *ff.AVCodecParameters
Return the codec parameters
func (*Stream) IsAttachedPic ¶
IsAttachedPic returns true if this stream is an attached picture (album art)
func (*Stream) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.