ffmpeg

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ffmpeg provides a safe FFmpeg subprocess wrapper. All processes are started with exec.CommandContext so they are killed when the context is cancelled — no orphan processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	Stdin  io.WriteCloser
	Stdout io.ReadCloser
	// contains filtered or unexported fields
}

Process wraps an FFmpeg subprocess with stdin/stdout pipes.

func Start

func Start(ctx context.Context, ffmpegPath string, args []string) (*Process, error)

Start launches FFmpeg with the given arguments. Both stdout and stderr are handled: stdout is exposed via Stdout, stderr lines are logged (DEBUG level, ERROR for fatal lines).

func (*Process) Close

func (p *Process) Close() error

Close terminates the FFmpeg process and closes stdin. Safe to call multiple times.

func (*Process) PID

func (p *Process) PID() int

PID returns the process ID of the running FFmpeg process.

func (*Process) Wait

func (p *Process) Wait() error

Wait waits for the FFmpeg process to exit and returns any error.

Jump to

Keyboard shortcuts

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