ffmpegstream

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ffmpegstream delivers outputs from one FFmpeg input traversal to independent, bounded consumers over private, child-authenticated pipes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachPipes

func AttachPipes(cmd *exec.Cmd, outputs []Pipe)

AttachPipes installs write ends before Start. cmd must have no existing ExtraFiles.

func ClosePipes

func ClosePipes(pipes []Pipe)

ClosePipes releases listeners and any pipe ends not transferred to consumers.

Types

type Output

type Output struct {
	Arguments []string
	Consume   func(io.Reader) error
}

Output supplies backend-owned output arguments, excluding the destination. Consume must read to EOF. An unsuccessful consumer is drained so siblings can finish; cancellation closes every pipe and waits for the child.

type Pipe

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

Pipe owns one child's output stream. Use NewPipes to initialize it.

func NewPipes

func NewPipes(count int) ([]Pipe, error)

NewPipes creates count output pipes; the caller must release them with ClosePipes.

func (*Pipe) Close

func (p *Pipe) Close()

func (*Pipe) Destination

func (p *Pipe) Destination() string

func (*Pipe) Reader

func (p *Pipe) Reader(context.Context, int) (io.ReadCloser, error)

Reader returns the inherited pipe's read end; callers own read cancellation.

func (*Pipe) Started

func (p *Pipe) Started()

Started closes the parent's write end after the child inherits it.

type Result

type Result struct {
	Errors       []error
	ProcessError error
}

Result distinguishes consumer failures from a failed shared process.

func Run

func Run(ctx context.Context, cmd *exec.Cmd, outputs []Output) (Result, error)

Run attaches all private outputs before starting a caller-configured command. cmd.Args already contains input and global options. Diagnostics must be set by the caller; no source paths or subprocess output are logged here.

Jump to

Keyboard shortcuts

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