### Install Membrane File Plugin with Mix Source: https://hexdocs.pm/membrane_file_plugin/index This code snippet shows how to add the `membrane_file_plugin` to your project's dependencies in the `mix.exs` file. Ensure your project uses Mix for dependency management. ```elixir def deps do [ {:membrane_file_plugin, "~> 0.17.2"} ] end ``` -------------------------------- ### Membrane.File.Sink.Multi Options Function Source: https://hexdocs.pm/membrane_file_plugin/Membrane.File.Sink A function that returns a keyword list describing the available options for the Membrane.File.Sink.Multi module. ```elixir @spec options() :: keyword() ``` -------------------------------- ### Membrane.File.Sink.Multi Element Options Source: https://hexdocs.pm/membrane_file_plugin/Membrane.File.Sink Defines the configuration options for the Membrane.File.Sink.Multi element, including location, extension, naming function, and split event. ```elixir location :: Path.t() extension :: String.t() naming_fun :: (Path.t(), non_neg_integer(), String.t() -> Path.t()) split_event :: Membrane.Event.t() ``` -------------------------------- ### Membrane.File.Sink.Multi Element Source: https://hexdocs.pm/membrane_file_plugin/Membrane.File.Sink The Membrane.File.Sink.Multi element writes buffers to a set of files, switching files based on specified events. It provides options for configuring file naming, extensions, and split events. ```APIDOC ## Membrane.File.Sink.Multi Element Documentation ### Description Element that writes buffers to a set of files. File is switched on event. Files are named according to `naming_fun` passed in options. This function receives sequential number of file and should return string. It defaults to `path/to/file0.ext`, `path/to/file1.ext`, ... The event type, which starts writing to a next file is passed by `split_event` option. It defaults to `Membrane.File.SplitEvent`. ### Element Options Passed via struct `Membrane.File.Sink.Multi.t/0` #### Path Parameters * **location** (Path.t()) - Required - Base path to the file, will be passed to the naming function. * **extension** (String.t()) - Optional - Extension of the file, should be preceeded with dot (.). Defaults to `""`. It is passed to the naming function. * **naming_fun** ((Path.t(), non_neg_integer(), String.t() -> Path.t())) - Optional - Function accepting base path, sequential number and file extension, and returning file path as a string. Default one generates path/to/file0.ext, path/to/file1.ext, ... * **split_event** (Membrane.Event.t()) - Optional - Event causing switching to a new file. Defaults to `Membrane.File.SplitEvent`. ### Pads #### :input Accepted formats: `_any` Direction: `:input` Availability: `:always` Flow control: `:manual` Demand unit: `:buffers` ### Types #### t() Struct containing options for `Membrane.File.Sink.Multi` ```elixir @type t() :: %Membrane.File.Sink.Multi{ extension: String.t(), location: Path.t(), naming_fun: (Path.t(), non_neg_integer(), String.t() -> Path.t()), split_event: Membrane.Event.t() } ``` ### Functions #### default_naming_fun(path, i, ext) ```elixir @spec default_naming_fun(Path.t(), non_neg_integer(), String.t()) :: Path.t() ``` #### options() ```elixir @spec options() :: keyword() ``` Returns description of options available for this module. ``` -------------------------------- ### Membrane.File.Sink.Multi Default Naming Function Source: https://hexdocs.pm/membrane_file_plugin/Membrane.File.Sink The default function for naming files when writing buffers. It accepts the base path, a sequential number, and the file extension. ```elixir @spec default_naming_fun(Path.t(), non_neg_integer(), String.t()) :: Path.t() ``` -------------------------------- ### Membrane.File.Sink.Multi Struct Definition Source: https://hexdocs.pm/membrane_file_plugin/Membrane.File.Sink Defines the 't()' type, which is a struct containing the options for Membrane.File.Sink.Multi. ```elixir @type t() :: %Membrane.File.Sink.Multi{ extension: String.t(), location: Path.t(), naming_fun: (Path.t(), non_neg_integer(), String.t() -> Path.t()), split_event: Membrane.Event.t() } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.