Documentation
¶
Overview ¶
Package selfcheck proves a transcoder image can do its class's work: it loads FFmpeg 9 and the ffgo shim in-process (pkg/ffruntime), finds every encoder, muxer and filter the class needs by name, and encodes with the CPU encoders. CI runs it on every built image (`transcode --self-check=<class>`), so a missing library fails the build, not a job; Trial adds a real encode on the class's GPU.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Needs = map[Class]Need{ ClassCPU: { Encoders: []string{"libx265", "aac", "ac3"}, Muxers: []string{"mp4", "srt"}, }, ClassCUDA: { Encoders: []string{"libx265", "aac", "ac3", "hevc_nvenc"}, Muxers: []string{"mp4", "srt"}, Filters: []string{"scale_cuda", "hwupload"}, }, ClassIntel: { Encoders: []string{"libx265", "aac", "ac3", "hevc_qsv", "hevc_vaapi"}, Muxers: []string{"mp4", "srt"}, Filters: []string{"vpp_qsv", "scale_vaapi", "hwupload"}, }, }
Needs is each class's encoders, muxers and filters. Since standard Version 2 every class encodes with ac3 a surround track that is not E-AC-3 or AC-3, and writes the MP4 and its SubRip and ASS sidecars through the mp4 and srt muxers (spec 2026-10-06 §7.4; no ass muxer since standard.Version 5).
var RuntimeLibs = map[Class][]RuntimeLib{ ClassIntel: { {Name: "libva.so.2", Symbols: []string{"vaInitialize", "vaMapBuffer2"}}, {Name: "libva-drm.so.2", Symbols: []string{"vaGetDisplayDRM"}}, {Name: "$LIBVA_DRIVERS_PATH/iHD_drv_video.so"}, {Name: "libmfx-gen.so.1.2"}, {Name: "libmfxhw64.so.1"}, }, }
RuntimeLibs is each class's run-time libraries. Intel's are what the transcoder image stages on amd64 for BtbN's libva stubs (which call libva 2.21's vaMapBuffer2: with Debian 12's libva 2.17 they abort the process), the iHD driver libva loads, and both QSV runtimes the libvpl dispatcher loads. NVIDIA's driver libraries are the container toolkit's to inject, so the CUDA class has none here; its trial opens the device.
Functions ¶
func IntelRenderNode ¶
func IntelRenderNode() string
IntelRenderNode is the first DRM render node whose PCI vendor is Intel (0x8086) and that this container has and can open, or "": a node with both an Intel iGPU and an NVIDIA card has two, and only Intel's takes VAAPI and QSV. /sys/class/drm is the host's even in a container, so a node the device plugin did not mount is passed over -- opening VAAPI on it falls back to X11, and BtbN's libX11 stub aborts the process.
Types ¶
type Report ¶
type Report struct {
FFmpegMajor int `json:"ffmpegMajor"`
ShimMatched bool `json:"shimMatched"`
ShimAPI int `json:"shimAPI"`
ShimPath string `json:"shimPath,omitempty"`
Encoders map[string]bool `json:"encoders"`
Muxers map[string]bool `json:"muxers"`
Filters map[string]bool `json:"filters"`
// Trials holds each trial encode's error message, "" for success.
Trials map[string]string `json:"trials,omitempty"`
}
Report is what a check found; it is printed as JSON by --self-check.
type RuntimeLib ¶
type RuntimeLib struct {
// Name is a soname or a path; $VAR is expanded from the environment.
Name string
Symbols []string
}
RuntimeLib is a library a class's image must be able to load at run time, with the symbols it must export: what nothing's DT_NEEDED names because FFmpeg (BtbN's library stubs), libva or libvpl dlopen it.