Documentation
¶
Overview ¶
Package worker is one warm live-rung worker process: a long-lived process that keeps its GPU context (CUDA, when the machine has one) and makes one job at a time through the media libraries (go-astiav on FFmpeg 7.1): decode, scale, tone-map and encode in-process, the CMAF written in Go. The supervisor runs one such process per encode slot, so a crash, a kill or a stall costs that one job, which the supervisor makes again elsewhere.
It answers the API of package api over a Unix socket (or TCP), to the supervisor only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
ID string
Socket string // a Unix socket path; else Addr
Addr string
// HW is auto (CUDA when a device opens, else the CPU), cuda,
// videotoolbox (a local smoke test on macOS) or none.
HW string
Device string // the CUDA device
// Slots is how many jobs run at once (the supervisor sends one at a
// time; 1 makes a crash cost one job).
Slots int
Queue int
DecodeThreads int
EncodeThreads int
FilterThreads int
ExtraHWFrames int
Stall time.Duration
Deadline time.Duration
MaxRSS int64 // bytes; refuse new jobs above it (0: no limit)
PoolInputs int
PoolDecoders int
GPUTonemap string // auto | interop | roundtrip | cpu
LogLevel string
Roots []string
// Faults are failures to have, for the chaos tests (leak:MBPS,
// crash-after:N, stall-after:N). Never set in service.
Faults string
}
Config is a worker process's configuration.
type Health ¶
type Health struct {
OK bool `json:"ok"`
ID string `json:"id"`
Backend string `json:"backend"`
Note string `json:"note,omitempty"`
FFmpeg string `json:"ffmpeg"`
Slots int `json:"slots"`
Busy int `json:"busy"`
Jobs int `json:"jobs"` // in the registry: queued, running, or aborted and not returned
Waiting int64 `json:"waiting"`
UptimeSec float64 `json:"uptimeSec"`
Wedged string `json:"wedged,omitempty"`
PID int `json:"pid"`
RSS int64 `json:"rss"`
}
Health is a worker process's /healthz.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ffx fills the gaps of the go-astiav binding (v0.39.0, the last release for FFmpeg 7.x) the worker needs, with small cgo calls into the same libraries.
|
Package ffx fills the gaps of the go-astiav binding (v0.39.0, the last release for FFmpeg 7.x) the worker needs, with small cgo calls into the same libraries. |