VideoMixer.FilterGraph (video_mixer v2.1.6)

View Source

Summary

Functions

Returns just the filter-graph string for a named layout, with the terminal output label renamed if :terminal_label is provided. Useful when chaining the layout's output into a larger graph — e.g. layering an image overlay on top of the layout's result.

Types

layout()

@type layout() ::
  :single_fit
  | :hstack
  | :vstack
  | :xstack
  | :primary_sidebar
  | :primary_sidebar_cropped

role()

@type role() ::
  :primary
  | :sidebar
  | :left
  | :right
  | :top
  | :bottom
  | :top_left
  | :top_right
  | :bottom_left
  | :bottom_right

Functions

build(layout, specs_by_role, output_spec, opts \\ [])

@spec build(
  layout(),
  keyword(VideoMixer.FrameSpec.t()) | map(),
  VideoMixer.FrameSpec.t() | map(),
  keyword()
) ::
  {:ok,
   %{
     graph: String.t(),
     filter_indexes: [non_neg_integer()],
     input_order: [role()],
     mapping: [VideoMixer.FrameSpec.t()]
   }}
  | {:error, VideoMixer.Error.t()}

layout_graph(layout, specs_by_role, output_spec, opts \\ [])

@spec layout_graph(
  layout(),
  keyword(VideoMixer.FrameSpec.t()) | map(),
  VideoMixer.FrameSpec.t() | map(),
  keyword()
) :: {:ok, String.t()} | {:error, VideoMixer.Error.t()}

Returns just the filter-graph string for a named layout, with the terminal output label renamed if :terminal_label is provided. Useful when chaining the layout's output into a larger graph — e.g. layering an image overlay on top of the layout's result.

Defaults to [out] (matching build/3).

Examples

{:ok, body} = FilterGraph.layout_graph(:single_fit, %{primary: spec}, out, terminal_label: "base")
full = "#{body};[1:v]format=yuva420p,scale=W:H[ovl];[base][ovl]overlay=...[out]"