Membrane.RTC.Engine.Endpoint.File (Membrane RTC Engine File Endpoint v0.8.0)
View SourceAn Endpoint responsible for publishing data from a file.
By default only supports OPUS encapsulated in Ogg container and raw H264 files.
By providing proper value in option after_source_transformation you can read other formats, but the output from after_source_transformation have to be encoded in OPUS or H264.
It can start publishing data in three different moments:
- immediately after initialization, if
playback_modeis set to:autoplay(default), - after calling
playback_modefunction with proper arguments, ifplayback_modeis set to:manual - after other endpoint subscribes on this endpoint track, if
playback_modeis set to:wait_for_first_subscriberCurrently, the File Endpoint only supports files that contain a single media track.
Bin options
Passed via struct Membrane.RTC.Engine.Endpoint.File.t/0
rtc_enginepid()Required
Pid of parent Enginefile_pathPath.t()Required
Path to track filetrack_configTrackConfig.t()Required
Configuration of the track being publishedssrcRTP.ssrc()Default value:
nil
SSRC of RTP packetspayload_typeRTP.payload_type()Required
Payload type of RTP packetsplayback_mode:autoplay | :manual | :wait_for_first_subscriberDefault value:
:autoplay
Indicates, when the endpoint should start sending data:- autoplay - start immediately after initialization
- manual - start on calling
start_sending/2function - wait_for_first_subscriber - start when the first endpoint subscribes on the track
autoendboolean()Default value:
true
Indicates, whether the endpoint should send:finishednotification to engine immediately after processing all data. If set to `false`, the endpoint hast to be removed manually.after_source_transformation(ChildrenSpec.builder() -> ChildrenSpec.builder())Default value:
&Function.identity/1
Additional pipeline transformation afterfile_source. The output stream must be encoded in OPUS or H264.Use this option when the provided file uses encoding other than Ogg encapsulated OPUS audio or H264 video.
Example usage:
- Reading ACC file:
fn link_builder -> link_builder |> child(:decoder, Membrane.AAC.FDK.Decoder) |> child(:encoder, %Membrane.Opus.Encoder{input_stream_format: %Membrane.RawAudio{ channels: 1, sample_rate: 48_000, sample_format: :s16le }}) end
- Reading ACC file:
Pads
:output
Accepted formats:
Membrane.RTP| Direction: | :output |
| Availability: | :on_request |
Summary
Functions
Returns description of options available for this module
Types
@type encoding_t() :: String.t()
@type t() :: %Membrane.RTC.Engine.Endpoint.File{ after_source_transformation: (Membrane.ChildrenSpec.builder() -> Membrane.ChildrenSpec.builder()), autoend: boolean(), file_path: Path.t(), payload_type: Membrane.RTP.payload_type(), playback_mode: :autoplay | :manual | :wait_for_first_subscriber, rtc_engine: pid(), ssrc: Membrane.RTP.ssrc(), track_config: Membrane.RTC.Engine.Endpoint.File.TrackConfig.t() }
Struct containing options for Membrane.RTC.Engine.Endpoint.File