# Membrane Funnel plugin

[![API Docs](](

Membrane plugin for merging multiple input streams into a single output.

It can be used for collecting data from multiple inputs and sending it through one output.

It is part of [Membrane Multimedia Framework](

## Installation

The package can be installed by adding `membrane_funnel_plugin` to your list of dependencies in `mix.exs`:

def deps do
    {:membrane_funnel_plugin, "~> 0.6.0"}

## Usage
Playing this pipeline should merge two files `a.txt` and `b.txt` into file `c.txt`

defmodule FunnelDemo do
  use Membrane.Pipeline

  def handle_init(_) do
    children = [
      a_source: %Membrane.File.Source{location: "a.txt"},
      b_source: %Membrane.File.Source{location: "b.txt"},
      funnel: Membrane.Funnel,
      sink: %Membrane.File.Sink{location: "c.txt"}

    links = [
      link(:a_source) |> to(:funnel),
      link(:b_source) |> to(:funnel),
      link(:funnel) |> to(:sink)

    spec = %ParentSpec{children: children, links: links}
    {{:ok, spec: spec}, %{}}

For more examples please refer to our [echo demo](
where we use funnel plugin to send two RTP streams using the same connection, or our integration

## Copyright and License

Copyright 2020, [Software Mansion](

[![Software Mansion](](

Licensed under the [Apache License, Version 2.0](LICENSE)