gomediaprocessing

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: LGPL-3.0 Imports: 12 Imported by: 0

README

go-media-processing

A module for golang to process media (written for VideoGraf).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileNotFound = errors.New("File not found")
View Source
var ErrInvalidPath = errors.New("Invalid path")
View Source
var ErrNoStreamFound = errors.New("No stream found in file")
View Source
var ErrNotAFile = errors.New("Path is not pointing to a file")

Functions

func GenerateEffectFilter added in v0.5.0

func GenerateEffectFilter(input string, output string, effectName string, keyframes Keyframes) string

Generate the needed filter string for ffmpeg's filter_complex option

func GenerateFFmpegAudio added in v0.7.0

func GenerateFFmpegAudio(sources []SourceAudio, effects []Effect, timeline []TimelineAudio, output Audio) string

Generate an ffmpeg command to render audio

func GenerateFFmpegVideo added in v0.7.0

func GenerateFFmpegVideo(sources []SourceVideo, effects []Effect, timeline []TimelineVideo, output Video) string

Generate an ffmpeg command to render video

Types

type Audio added in v0.2.0

type Audio struct {
	Path          string
	Duration      time.Duration
	Codec         string
	SampleRate    uint32
	Channels      uint16
	ChannelLayout string
}

func LoadAudio added in v0.2.0

func LoadAudio(inputPath string) (audio Audio, err error)

type Effect added in v0.5.0

type Effect struct {
	SourceID  string
	ID        string
	Type      string
	Keyframes Keyframes
}

type Keyframe added in v0.8.0

type Keyframe map[string]any

type Keyframes added in v0.8.0

type Keyframes map[time.Duration]Keyframe

type SourceAudio added in v0.7.0

type SourceAudio struct {
	Path string
	ID   string
}

type SourceVideo added in v0.7.0

type SourceVideo struct {
	Path string
	ID   string
}

type TimelineAudio added in v0.7.0

type TimelineAudio struct {
	SourceID  string
	ID        string
	Layer     uint16
	StartTime time.Duration
}

type TimelineVideo added in v0.5.0

type TimelineVideo struct {
	SourceID  string
	ID        string
	Layer     uint16
	StartTime time.Duration
}

type Video

type Video struct {
	Path       string
	Duration   time.Duration
	Codec      string
	Height     uint32
	Width      uint32
	Framerate  float32
	ColorSpace string
}

func LoadVideo

func LoadVideo(inputPath string) (video Video, err error)

Jump to

Keyboard shortcuts

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