Documentation
¶
Overview ¶
Package ffmpeg renders a keryx timeline into a finished MP4 by shelling out to ffmpeg — the default Renderer adapter (spec §3.4). The command/filtergraph construction (buildArgs) is pure and unit-tested; the exec is injected so the logic tests run without ffmpeg, and the real renderer is exercised by integration tests. Faithful port of gen-reel.py's ffmpeg assembly.
Index ¶
- func ProbeDuration(ctx context.Context, path string) (float64, error)
- type Renderer
- func (r *Renderer) DetectSilence(ctx context.Context, fs afero.Fs, path string) ([]provider.Silence, error)
- func (r *Renderer) Probe(ctx context.Context, fs afero.Fs, path string) (float64, error)
- func (r *Renderer) Render(ctx context.Context, fs afero.Fs, t provider.Timeline) (provider.Video, error)
- func (r *Renderer) RenderProgress(ctx context.Context, fs afero.Fs, t provider.Timeline, ...) (provider.Video, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer is the local-ffmpeg implementation of provider.Renderer.
func (*Renderer) DetectSilence ¶ added in v0.4.0
func (r *Renderer) DetectSilence(ctx context.Context, fs afero.Fs, path string) ([]provider.Silence, error)
DetectSilence runs the silencedetect filter over path (materialising a non-OS fs first) and returns the detected intervals — the optional SilenceDetector capability for VO take screening (spec 0023). `-f null` discards the decoded audio; the filter logs the silences to stderr, which realExec captures via CombinedOutput.
func (*Renderer) Probe ¶
Probe returns a media file's duration in seconds via ffprobe. For a non-OS fs the file is materialised to a temp path first (ffprobe reads only real OS files).
func (*Renderer) Render ¶
func (r *Renderer) Render(ctx context.Context, fs afero.Fs, t provider.Timeline) (provider.Video, error)
Render assembles the timeline (whose paths are in fs) into t.OutputPath. The ffmpeg binary can only read real OS files: when fs is OS-backed the timeline paths are used directly; otherwise (an in-memory / git-worktree fs) the inputs are materialised to a temp dir, rendered, and the mp4 copied back into fs.
func (*Renderer) RenderProgress ¶ added in v0.8.0
func (r *Renderer) RenderProgress(ctx context.Context, fs afero.Fs, t provider.Timeline, onProgress func(provider.Progress)) (provider.Video, error)
RenderProgress renders while streaming a live percentage to onProgress, satisfying provider.ProgressRenderer (spec 0026). It taps ffmpeg's `-progress` output against the timeline's total duration; a nil onProgress behaves like Render.