package fehu

  1. Overview
  2. Docs

Module Fehu_visualize.SinkSource

Sourcetype t
Sourceval custom : ?close:(unit -> unit) -> (Fehu.Render.t -> unit) -> t

Create a sink from a push callback and optional close action.

Sourceval noop : t

Sink that drops all frames.

Sourceval ffmpeg : ?fps:int -> path:string -> unit -> t

Stream frames to an ffmpeg process producing a video file.

Sourceval gif : ?fps:int -> path:string -> unit -> t

Stream frames to ffmpeg configured for GIF output.

Sourceval wandb : ?fps:int -> project:string -> run:string -> unit -> t

Capture frames, encode to MP4, and log to Weights & Biases via Python.

Sourceval close : t -> unit

Flush and finalize the sink.

Sourceval push : t -> Fehu.Render.t -> unit

Push a single frame to the sink.

Sourceval with_sink : (unit -> t) -> (t -> 'a) -> 'a

with_sink create f creates a sink via create, runs f, and guarantees the sink is closed afterwards.

Sourceval with_ffmpeg : ?fps:int -> path:string -> (t -> 'a) -> 'a

Convenience wrapper around ffmpeg that automatically closes the sink.

Sourceval with_gif : ?fps:int -> path:string -> (t -> 'a) -> 'a

Convenience wrapper around gif that automatically closes the sink.

Sourceval with_wandb : ?fps:int -> project:string -> run:string -> (t -> 'a) -> 'a

Convenience wrapper around wandb that automatically closes the sink.