Membrane.HTTPAdaptiveStream.Sink (Membrane HTTP Adaptive Stream plugin v0.3.0) View Source
Sink for generating HTTP streaming manifests.
Uses Membrane.HTTPAdaptiveStream.Manifest for manifest serialization
and Membrane.HTTPAdaptiveStream.Storage for saving files.
Notifications
{:track_playable, input_pad_id}- sent when the first segment of a track is stored, and thus the track is ready to be played{:cleanup, cleanup_function :: (()-> :ok)}- sent when playback changes from playing to prepared. Invokingcleanup_functionlambda results in removing all the files that remain after the streaming
Examples
The following configuration:
%Membrane.HTTPAdaptiveStream.Sink{
manifest_name: "manifest",
manifest_module: Membrane.HTTPAdaptiveStream.HLS,
storage: %Membrane.HTTPAdaptiveStream.Storages.FileStorage{directory: "output"}
}will generate a HLS manifest in the output directory, playable from
output/manifest.m3u8 file.
Element options
Passed via struct Membrane.HTTPAdaptiveStream.Sink.t/0
manifest_nameString.t()Default value:
"index"
Name of the main manifest filemanifest_modulemoduleRequired
Implementation of theMembrane.HTTPAdaptiveStream.Manifestbehaviour.storageStorage.config_t()Required
Storage configuration. May be one ofMembrane.HTTPAdaptiveStream.Storages.*. SeeMembrane.HTTPAdaptiveStream.Storagebehaviour.target_window_durationpos_integer | :infinityDefault value:
5 |> Membrane.Time.seconds()
Manifest duration is keept above that time, while the oldest segments are removed whenever possible.persist?anyDefault value:
false
If true, stale segments are removed from the manifest only. Once playback finishes, they are put back into the manifest.target_segment_durationTime.t()Default value:
0 |> Membrane.Time.days()
Expected length of each segment. Setting it is not necessary, but may help players achieve better UX.
Pads
:input
| Availability | :on_request |
| Caps | Membrane.CMAF.Track |
| Demand unit | :buffers |
| Direction | :input |
| Mode | :pull |
| Name | :input |
Link to this section Summary
Types
Struct containing options for Membrane.HTTPAdaptiveStream.Sink
Functions
Returns pads descriptions for Membrane.HTTPAdaptiveStream.Sink
Returns description of options available for this module
Link to this section Types
Specs
t() :: %Membrane.HTTPAdaptiveStream.Sink{
manifest_module: module(),
manifest_name: String.t(),
persist?: any(),
storage: Membrane.HTTPAdaptiveStream.Storage.config_t(),
target_segment_duration: Membrane.Time.t(),
target_window_duration: pos_integer() | :infinity
}
Struct containing options for Membrane.HTTPAdaptiveStream.Sink
Link to this section Functions
Specs
membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]
Returns pads descriptions for Membrane.HTTPAdaptiveStream.Sink
Specs
options() :: keyword()
Returns description of options available for this module