View Source Membrane.RTC.Engine.Endpoint.HLS (Membrane RTC Engine v0.10.0)
An Endpoint responsible for converting incoming tracks to HLS playlist.
This module requires the following plugins to be present in your mix.exs
for H264 & OPUS input:
[
:membrane_h264_ffmpeg_plugin,
:membrane_http_adaptive_stream_plugin,
]
It can perform transcoding (see Membrane.RTC.Engine.Endpoint.HLS.TranscodingConfig
),
in such case these plugins are also needed:
[
:membrane_ffmpeg_swscale_plugin,
:membrane_framerate_converter_plugin
]
Plus, optionally it supports OPUS audio input - for that, additional dependencies are needed:
[
:membrane_opus_plugin,
:membrane_aac_plugin,
:membrane_aac_fdk_plugin
]
bin-options
Bin options
Passed via struct Membrane.RTC.Engine.Endpoint.HLS.t/0
rtc_engine
pid()
Required
Pid of parent Engineoutput_directory
Path.t()
Default value:
"hls_output"
Path to directory under which HLS output will be savedowner
pid()
Required
Pid of parent all notifications will be send to.These notifications are:
{:playlist_playable, content_type, stream_id, origin}
{:cleanup, clean_function, stream_id}
hls_mode
:separate_av | :muxed_av
Default value:
:separate_av
Defines output mode forMembrane.HTTPAdaptiveStream.SinkBin
.:separate_av
- audio and video tracks will be separated:muxed_av
- audio will be attached to every video track
target_window_duration
Membrane.Time.t() | :infinity
Default value:
20 |> Membrane.Time.seconds()
Max duration of stream that will be stored. Segments that are older than window duration will be removed.target_segment_duration
Membrane.Time.t()
Default value:
5 |> Membrane.Time.seconds()
Expected length of each segment. Setting it is not necessary, but may help players achieve better UX.framerate
{integer(), integer()} | nil
Default value:
nil
Framerate of input trackstranscoding_config
TranscodingConfig.t()
Default value:
%Membrane.RTC.Engine.Endpoint.HLS.TranscodingConfig{enabled?: false, output_framerate: {24, 1}, output_width: 1280, output_height: 720}
Transcoding configuration
pads
Pads
input
:input
Availability | :on_request |
Caps | :any |
Demand unit | :buffers |
Direction | :input |
Mode | :pull |
Name | :input |
Link to this section Summary
Types
Struct containing options for Membrane.RTC.Engine.Endpoint.HLS
Functions
Returns pads descriptions for Membrane.RTC.Engine.Endpoint.HLS
Returns description of options available for this module
Link to this section Types
@type t() :: %Membrane.RTC.Engine.Endpoint.HLS{ framerate: {integer(), integer()} | nil, hls_mode: :separate_av | :muxed_av, output_directory: Path.t(), owner: pid(), rtc_engine: pid(), target_segment_duration: Membrane.Time.t(), target_window_duration: Membrane.Time.t() | :infinity, transcoding_config: Membrane.RTC.Engine.Endpoint.HLS.TranscodingConfig.t() }
Struct containing options for Membrane.RTC.Engine.Endpoint.HLS
Link to this section Functions
@spec membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]
Returns pads descriptions for Membrane.RTC.Engine.Endpoint.HLS
@spec options() :: keyword()
Returns description of options available for this module