View Source Membrane.FFmpeg.VideoFilter.TextOverlay (Membrane FFmpeg Video Filter plugin v0.13.1)

Element adding text overlay to raw video frames - using 'drawtext' video filter from FFmpeg Library. (https://ffmpeg.org/ffmpeg-filters.html#drawtext-1). Element allows for specifying most commonly used 'drawtext' settings (such as fontsize, fontcolor) through element options.

The element expects each frame to be received in a separate buffer. Additionally, the element has to receive proper stream format with picture format and dimensions.

Element options

Passed via struct Membrane.FFmpeg.VideoFilter.TextOverlay.t/0

  • text

    any

    Default value: nil
    Text to be displayed on video. Either text or text_intervals must be provided

  • text_intervals

    [{{Time.t(), Time.t() | :infinity}, String.t()}]

    Default value: []
    List of time intervals when each given text should appear. Intervals should not overlap.

                Either text or text_intervals must be provided
  • font_size

    any

    Default value: 12
    Size of the displayed font

  • font_color

    any

    Default value: "black"
    Choose font color according to the ffmpeg color syntax (https://ffmpeg.org/ffmpeg-utils.html#color-syntax)

  • font_file

    any

    Default value: nil
    Path to the file with the desired font. If not set, default font fallback from fontconfig is used

  • box?

    any

    Default value: false
    Set to true if a box is to be displayed behind the text

  • box_color

    any

    Default value: "white"
    If the box? is set to true, display a box in the given color

  • border_width

    any

    Default value: 0
    Set the width of the border around the text

  • border_color

    any

    Default value: "black"
    Set the color of the border, if exists

  • horizontal_align

    :left | :right | :center

    Default value: :left
    Horizontal position of the displayed text

  • vertical_align

    :top | :bottom | :center

    Default value: :bottom
    Vertical position of the displayed text

Pads

:input

Accepted formats:

%RawVideo{aligned: true}
Direction::input
Availability::always
Flow control::auto

:output

Accepted formats:

%RawVideo{aligned: true}
Direction::output
Availability::always
Flow control::auto

Summary

Types

t()

Struct containing options for Membrane.FFmpeg.VideoFilter.TextOverlay

Functions

Returns description of options available for this module

Types

@type t() :: %Membrane.FFmpeg.VideoFilter.TextOverlay{
  border_color: any(),
  border_width: any(),
  box?: any(),
  box_color: any(),
  font_color: any(),
  font_file: any(),
  font_size: any(),
  horizontal_align: :left | :right | :center,
  text: any(),
  text_intervals: [{{Time.t(), Time.t() | :infinity}, String.t()}],
  vertical_align: :top | :bottom | :center
}

Struct containing options for Membrane.FFmpeg.VideoFilter.TextOverlay

Functions

@spec options() :: keyword()

Returns description of options available for this module