View Source Membrane.VideoCompositor.BaseVideoPlacement (Membrane Video Compositor plugin v0.7.0)

A struct describing the video position, size and z-value for use with the rust-based compositor on the output frame, before video transformations.

Values

  • position: tuple given in pixels, relative to the top right corner of the output frame, represents the position on the output frame before transformations
  • size: tuple given in pixels, represents video resolution on the output frame before transformations
  • z_value: float in [0.0, 1.0] range, specifies priority: videos with higher z_values are 'in front' of videos with lower z_values

Examples

If you want to place the video in the bottom left quarter of the 4k output frame, above videos on 0.0 z_value level:

  iex> alias Membrane.VideoCompositor.BaseVideoPlacement
  Membrane.VideoCompositor.BaseVideoPlacement
  iex> %BaseVideoPlacement{ position: {1920, 1080}, size: {1920, 1080}, z_value: 0.5}
  %Membrane.VideoCompositor.BaseVideoPlacement{
    position: {1920, 1080},
    size: {1920, 1080},
    z_value: 0.5
  }

Summary

Types

@type t() :: %Membrane.VideoCompositor.BaseVideoPlacement{
  position: {integer(), integer()},
  size: {non_neg_integer(), non_neg_integer()},
  z_value: float()
}