Raxol. Recording. Video
(Raxol v2.6.0)
View Source
Video render target: turn a Raxol screen buffer into a rasterized frame.
This is the foundation of the LiveView -> video pipeline. A Raxol.Core.Buffer
is rendered to a self-contained, themed HTML document via
Raxol.LiveView.TerminalBridge and then rasterized to a PNG by a pluggable
Raxol.Recording.Video.Rasterizer backend. Stitching frames into MP4/WebM/GIF
(FFmpeg) and driving a virtual animation clock are later phases.
Summary
Functions
Boot a TEA module headlessly, step it over time while injecting scripted key events, capture each frame, and encode the result to a video file.
Boot a TEA module (or .exs path) headlessly, capture its current frame,
and render it to PNG bytes. Starts and stops a one-off headless session.
Like capture_frame/2, but writes the PNG to path.
Wrap a buffer's HTML in a standalone, self-contained document.
Render a single buffer to PNG bytes via the configured rasterizer.
Render a buffer straight to a PNG file on disk.
Functions
Boot a TEA module headlessly, step it over time while injecting scripted key events, capture each frame, and encode the result to a video file.
Frames change only when events fire, so this needs no animation clock for
event-driven apps. The output extension selects the format (.mp4/.webm/.gif).
Options
:fps- frames per second (default: 10):duration_ms- clip length (default: 2000):output- output path (default:"raxol_clip.gif"):events-[{ms, {:key, key}}]or[{ms, {:key, key, key_opts}}]:width/:height- session dimensions:event_settle_ms- wait after firing events so the update lands (default: 40)- plus all
render_frame/2options (:theme,:rasterizer, ...)
Boot a TEA module (or .exs path) headlessly, capture its current frame,
and render it to PNG bytes. Starts and stops a one-off headless session.
Options
:width/:height- session dimensions (forwarded toRaxol.Headless):settle_ms- wait before capture so the first frame renders (default: 50)- plus all
render_frame/2options (:theme,:rasterizer, ...)
@spec capture_frame_to_file(module() | Path.t(), Path.t(), keyword()) :: {:ok, Path.t()} | {:error, term()}
Like capture_frame/2, but writes the PNG to path.
Wrap a buffer's HTML in a standalone, self-contained document.
Colors are emitted inline (use_inline_styles: true) so the frame needs no
external stylesheet; the wrapper supplies font, background, and layout.
Render a single buffer to PNG bytes via the configured rasterizer.
Options
:theme-Raxol.LiveView.TerminalBridgetheme (default::default):rasterizer- backend module (default:HeadlessChrome):background- page background CSS color:font_family- CSS font stack
Render a buffer straight to a PNG file on disk.