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

Live queueing strategy, suitable for real-time processing, like live streams.

Every 1 / output fps seconds after start of composition (view latency/0) composes frames from every input stream with the smallest pts difference to output frame pts.

Summary

Types

Specifies possible strategies for VideoCompositor to send Membrane.Element.Action.end_of_stream/0.

Latency specifies when VideoCompositor will start producing frames.

Specifies how message scheduling EOS should look like.

Specifies the message that triggers/schedule the start of VC composing.

t()

Describes parameters of live queueing strategy.

Types

@type eos_strategy() :: :all_inputs_eos | :schedule_eos

Specifies possible strategies for VideoCompositor to send Membrane.Element.Action.end_of_stream/0.

Strategies:

  • In the :all_inputs_eos strategy VideoCompositor sends EOS after receiving EOSs from all input pads.
  • In the :schedule_eos strategy VideoCompositor sends EOS after receiving schedule_eos_message/0 and EOSs from all input pads. If all input pads sent EOS and VideoCompositor hasn't received the schedule_eos_message/0 message, VC will produce frames black frames until it receives the schedule_eos_message/0 message. This is useful, when e.g. some peer connects to a VideoCompositor via the live streaming application. His connection can be dropped and restored multiple times. With this strategy, user can control when VC should send EOS.
@type latency() :: Membrane.Time.non_neg() | :wait_for_start_event

Latency specifies when VideoCompositor will start producing frames.

Latency can be set to:

  • Membrane.Time.non_neg/0 - a fixed time, after which VC will start composing frames, Setting latency to a higher value allows VideoCompositor to await longer for input frames, but results in higher output stream latency and RAM usage.
  • :wait_for_start_event value, which awaits for t:start_composing_message/0 to trigger / schedule composing. Be aware that VC enqueues all received frames, so not sending t:start_composing_message/0 / sending it late, will result in high RAM usage.

It doesn't modify output frames pts.

Link to this type

schedule_eos_message()

View Source
@type schedule_eos_message() :: :schedule_eos

Specifies how message scheduling EOS should look like.

For more information on scheduling EOS see: eos_strategy/0.

@type start_timer_message() ::
  :start_composing | {:start_composing, delay :: Membrane.Time.non_neg()}

Specifies the message that triggers/schedule the start of VC composing.

Values:

  • After receiving :start_composing message, VC will immediately start composing.
  • After receiving {:start_composing, delay :: Membrane.Time.non_neg()}, VC will start composing after the time specified by delay
@type t() :: %Membrane.VideoCompositor.QueueingStrategy.Live{
  eos_strategy: eos_strategy(),
  latency: latency()
}

Describes parameters of live queueing strategy.

For more information, view: latency/0