hal/video.lisp
The ffmpeg rawvideo -pix_fmt for a renderer readback format.
Encode a video at pathname from frames function writes.
function receives one argument, a writer to call with each frame's packed
pixel bytes in format at width by height. Frames become an H.264 MP4 at
frame-rate via an ffmpeg subprocess; constant-rate-factor is x264's quality
knob (lower is better, 18 is visually lossless). An odd source dimension is
padded by one pixel because broadly playable yuv420p requires even dimensions.
Returns pathname and the number of frames written.
Evaluate body with writer bound as a local frame-writing function.
Call (writer pixels) once per frame; see call-with-video-encoder for
PATHNAME, width, height, and OPTIONS.
(format)(function pathname width height
&key (frame-rate 30)
(format :rgba8-unorm)
(constant-rate-factor 18))Encode a video at PATHNAME from frames FUNCTION writes. FUNCTION receives one argument, a writer to call with each frame's packed pixel bytes in FORMAT at WIDTH by HEIGHT. Frames become an H.264 MP4 at FRAME-RATE via an ffmpeg subprocess; CONSTANT-RATE-FACTOR is x264's quality knob (lower is better, 18 is visually…
Multiplication and scalar scaling.
Test whether two compatible scalars are equal.
((writer pathname width height &rest options)
&body body)Evaluate BODY with WRITER bound as a local frame-writing function. Call (WRITER pixels) once per frame; see CALL-WITH-VIDEO-ENCODER for PATHNAME, WIDTH, HEIGHT, and OPTIONS.
Video output for renderer readbacks: raw frames piped into ffmpeg.
The renderer already produces tightly packed
rgbaor BGRA bytes for PNG screenshots; a film is the same bytes written frame after frame into an ffmpeg child process reading rawvideo on stdin. ffmpeg owns pixel-format conversion, H.264 encoding, and the MP4 container, so no libav encoding binding is needed here -- the existing luv/libav system remains a decoder.