ffmpeg

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package ffmpeg provides wrappers for FFmpeg and FFprobe operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageDimensions

func GetImageDimensions(path string) (int, int, error)

GetImageDimensions uses ffprobe to get the actual width and height of an image

Types

type FFProbeFormat

type FFProbeFormat struct {
	Tags      map[string]string `json:"tags"`
	Duration  string            `json:"duration"`
	BitRate   string            `json:"bit_rate"`
	NbStreams int               `json:"nb_streams"`
}

FFProbeFormat represents the format section of ffprobe output

type FFProbeResult

type FFProbeResult struct {
	VideoStreams    []FFProbeStream `json:"-"`
	AudioStreams    []FFProbeStream `json:"-"`
	SubtitleStreams []FFProbeStream `json:"-"`
	AlbumArtStreams []FFProbeStream `json:"-"`
	Streams         []FFProbeStream `json:"streams"`
	Path            string          `json:"-"`
	Format          FFProbeFormat   `json:"format"`
	Duration        float64         `json:"-"`
}

FFProbeResult represents ffprobe JSON output

func ProbeMedia

func ProbeMedia(path string) (*FFProbeResult, error)

ProbeMedia probes a media file and returns metadata

type FFProbeStream

type FFProbeStream struct {
	Tags        map[string]string `json:"tags"`
	Disposition map[string]int    `json:"disposition"`
	CodecType   string            `json:"codec_type"`
	CodecName   string            `json:"codec_name"`
	Duration    string            `json:"duration"`
	NbFrames    string            `json:"nb_frames"`
	RFrameRate  string            `json:"r_frame_rate"`
	BitRate     string            `json:"bit_rate"`
	SampleRate  string            `json:"sample_rate"`
	Index       int               `json:"index"`
	Width       int               `json:"width"`
	Height      int               `json:"height"`
	Channels    int               `json:"channels"`
}

FFProbeStream represents a stream in ffprobe output

type FFmpegProcessor

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

FFmpegProcessor handles all FFmpeg-related operations

func NewFFmpegProcessor

func NewFFmpegProcessor(cfg *models.ProcessorConfig) *FFmpegProcessor

NewFFmpegProcessor creates a new FFmpeg processor

func (*FFmpegProcessor) Process

Process executes FFmpeg transcoding for audio/video files

Jump to

Keyboard shortcuts

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