View Source Membrane.RTC.Engine.Endpoint.HLS (Membrane RTC Engine HLS Endpoint v0.8.0)

An Endpoint responsible for converting incoming tracks to HLS playlist.

It can perform mixing audio and composing video (see Membrane.RTC.Engine.Endpoint.HLS.MixerConfig), in such case these plugins need to be present in your mix.exs:

[
  :membrane_video_compositor_plugin,
  :membrane_audio_mix_plugin
]

Bin options

Passed via struct Membrane.RTC.Engine.Endpoint.HLS.t/0

  • rtc_engine

    pid()

    Required
    Pid of parent Engine

  • owner

    pid()

    Required
    Pid of parent all notifications will be send to. These notifications are:

    • {:playlist_playable, content_type}
    • {:cleanup, clean_function}
  • output_directory

    Path.t()

    Default value: "hls_output"
    Path to directory under which HLS output will be saved

  • synchronize_tracks?

    boolean()

    Default value: true
    Set to false if source is different than webrtc. If set to true HLS Endpoint will calculate track offset based on handle_pad_added call.

  • mixer_config

    MixerConfig.t() | nil

    Default value: nil
    Audio and video mixer configuration. If you don't want to use compositor pass nil.

  • hls_config

    HLSConfig.t()

    Default value: %Membrane.RTC.Engine.Endpoint.HLS.HLSConfig{manifest_name: "index", manifest_module: Membrane.HTTPAdaptiveStream.HLS, storage: &Membrane.RTC.Engine.Endpoint.HLS.HLSConfig.default_storage/1, target_window_duration: 40000000000, persist?: false, mode: :live, hls_mode: :separate_av, header_naming_fun: &Membrane.HTTPAdaptiveStream.Manifest.Track.default_header_naming_fun/2, segment_naming_fun: &Membrane.HTTPAdaptiveStream.Manifest.Track.default_segment_naming_fun/1, segment_duration: 5000000000, partial_segment_duration: nil, cleanup_after: nil}
    HLS stream and playlist configuration.

  • subscribe_mode

    :auto | :manual

    Default value: :auto
    Whether tracks should be subscribed automatically when they're ready. If set to :manual hls endpoint will subscribe only to tracks from endpoints send using message: {:subscribe, endpoints}

Pads

:input

Accepted formats:

Membrane.RTP
Direction::input
Availability::on_request

Summary

Types

t()

Struct containing options for Membrane.RTC.Engine.Endpoint.HLS

Functions

Returns description of options available for this module

Subscribe hls endpoint to tracks from endpoints.

Types

@type t() :: %Membrane.RTC.Engine.Endpoint.HLS{
  hls_config: Membrane.RTC.Engine.Endpoint.HLS.HLSConfig.t(),
  mixer_config: Membrane.RTC.Engine.Endpoint.HLS.MixerConfig.t() | nil,
  output_directory: Path.t(),
  owner: pid(),
  rtc_engine: pid(),
  subscribe_mode: :auto | :manual,
  synchronize_tracks?: boolean()
}

Struct containing options for Membrane.RTC.Engine.Endpoint.HLS

Functions

@spec options() :: keyword()

Returns description of options available for this module

Link to this function

subscribe(engine, endpoint_id, endpoints)

View Source
@spec subscribe(engine :: pid(), endpoint_id :: any(), endpoints :: [any()]) :: :ok

Subscribe hls endpoint to tracks from endpoints.

It is only valid to use when hls has subscribe_mode set to :manual.