Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShellReader ¶
type ShellReader struct {
// contains filtered or unexported fields
}
ShellReader spawns a ffmpeg subprocess, exposes its stdout as a Reader, captures the tail of stderr in a fixed-size ring, and cleans up when the context is canceled or the process exits.
ShellReader is safe to use across goroutines for Close and Err. Read must be serialized by a single consumer (the convention for io.Reader).
func NewShellReader ¶
func NewShellReader(parent context.Context, program string, args []string, log *slog.Logger) (*ShellReader, error)
NewShellReader spawns program with args and starts the process. The returned reader streams stdout. If the program cannot be started, ErrFFmpegSpawn is returned wrapped.
func (*ShellReader) Close ¶
func (r *ShellReader) Close() error
Close terminates the subprocess and waits for the reaper.
func (*ShellReader) Done ¶
func (r *ShellReader) Done() <-chan struct{}
Done is closed when the subprocess exits.
func (*ShellReader) Err ¶
func (r *ShellReader) Err() error
Err returns the process exit error (after Done is closed).