View Source Membrane.File.Sink (Membrane File plugin v0.17.0)
Element that creates a file and stores incoming buffers there (in binary format). Can also be used as a pipe to standard output by setting location to :stdout, though this requires additional configuration.
When Membrane.File.SeekSinkEvent
is received, the element starts writing buffers starting
from position
. By default, it overwrites previously stored bytes. You can set insert?
field of the event to true
to start inserting new buffers without overwriting previous ones.
Please note, that inserting requires rewriting the file, what negatively impacts performance.
For more information refer to Membrane.File.SeekSinkEvent
moduledoc.
Pipeline logs are directed to standard output by default. To separate them from the sink's output we recommend redirecting the logger to standard error. For simple use cases using the default logger configuration (like stand-alone scripts) this can be achieved by simply calling redirect_logs_to_stderr/0. See examples/file_to_pipe.exs for a working example.
Element options
Passed via struct Membrane.File.Sink.t/0
location
Path.t() | :stdout
Required
Path of the output file or :stdout
Pads
:input
Accepted formats:
_any
Direction: | :input |
Availability: | :always |
Flow control: | :manual |
Demand unit: | :buffers |
Summary
Types
Struct containing options for Membrane.File.Sink
Functions
Returns description of options available for this module
Types
@type t() :: %Membrane.File.Sink{location: Path.t() | :stdout}
Struct containing options for Membrane.File.Sink
Functions
@spec options() :: keyword()
Returns description of options available for this module
@spec redirect_logs_to_stderr() :: :ok