View Source Membrane.HTTPAdaptiveStream.Sink (Membrane HTTP Adaptive Stream plugin v0.18.8)
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
Examples
The following configuration:
%Membrane.HTTPAdaptiveStream.Sink{
manifest_config: %ManifestConfig{name: "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_configManifestConfig.t()Required
track_configTrackConfig.t()Required
storageStorage.config_t()Required
Storage configuration. May be one ofMembrane.HTTPAdaptiveStream.Storages.*. SeeMembrane.HTTPAdaptiveStream.Storagebehaviour.cleanup_afternil | Membrane.Time.t()Default value:
nil
If notnil, time after a storage cleanup function should run.The function will remove all manifests and segments stored during the stream.
Pads
:input
Accepted formats:
CMAF.Track| Direction: | :input |
| Availability: | :on_request |
| Flow control: | :manual |
| Demand unit: | :buffers |
Pad options:
track_nameString.t() | nilDefault value:
nil
Name that will be used to name the media playlist for the given track, as well as its header and segments files. It must not contain any URI reserved characters.segment_durationMembrane.Time.t()Required
The minimal duration of media segments produced by this particular track.In case of regular paced streams the parameter may not have any impact, but when partial segments gets used it may decide when regular segments gets finalized and new gets started.
partial_segment_durationMembrane.Time.t() | nilDefault value:
nil
The target duration of partial segments.When set to nil then the track is not supposed to emit partial segments.
max_frameratefloat() | nilDefault value:
nil
The maximal framerate of video variant. This information is used in master playlist.When set to nil then this information won't be added to master playlist. For audio it should be set to nil.
Summary
Types
@type input_pad_opts() :: [ track_name: String.t() | nil, segment_duration: Membrane.Time.t(), partial_segment_duration: Membrane.Time.t() | nil, max_framerate: float() | nil ]
Options for pad :input
@type t() :: %Membrane.HTTPAdaptiveStream.Sink{ cleanup_after: nil | Membrane.Time.t(), manifest_config: Membrane.HTTPAdaptiveStream.Sink.ManifestConfig.t(), storage: Membrane.HTTPAdaptiveStream.Storage.config_t(), track_config: Membrane.HTTPAdaptiveStream.Sink.TrackConfig.t() }
Struct containing options for Membrane.HTTPAdaptiveStream.Sink
Functions
@spec options() :: keyword()
Returns description of options available for this module