# `Membrane.Scissors`
[🔗](https://github.com/membraneframework/membrane_scissors_plugin/blob/v0.8.1/lib/membrane_scissors.ex#L1)

Element for cutting the stream.
## Element options

Passed via struct `t:Membrane.Scissors.t/0`

- `intervals`  

  ```
  [{Time.t(), duration :: Time.t() | integer}] | Enumerable.t()
  ```
  
  ***Required***  
  Enumerable containing `{start_time, duration}` tuples specifying
  parts of the stream that should be preserved. All other parts are
  cut off. Duration unit should conform to the `interval_duration_unit`
  option. Note that infinite streams are also supported.

- `buffer_duration`  

  ```
  (Buffer.t(), accepted_format :: any -> Time.t())
  ```
  
  ***Required***  
  Function returning the duration of given buffer in Membrane Time units.

- `interval_duration_unit`  

  ```
  :time | :buffers
  ```
  
  Default value: `:time`  
  Unit of the duration of each interval in the `intervals` option.
  If `:buffers` is passed, given amount of buffers is preserved,
  unless the next interval starts earlier. In that case, the stream
  is cut according to the subsequent intervals.

- `filter`  

  ```
  (Buffer.t(), accepted_format :: any -> boolean)
  ```
  
  Default value: `&Membrane.Scissors.always_pass_filter/2`  
  Function for filtering buffers before they are cut. Each buffer
  is preserved iff it returns `true`. By default always returns `true`.

## Pads

### `:input`

Accepted formats:
```
_any
```

Direction: | `:input`
Availability: | `:always`
Flow control: | `:manual`
Demand unit: | `:buffers`

### `:output`

Accepted formats:
```
_any
```

Direction: | `:output`
Availability: | `:always`
Flow control: | `:manual`
Demand unit: | `nil`

# `t`

```elixir
@type t() :: %Membrane.Scissors{
  buffer_duration: (Membrane.Buffer.t(), accepted_format :: any() -&gt;
                      Membrane.Time.t()),
  filter: (Membrane.Buffer.t(), accepted_format :: any() -&gt; boolean()),
  interval_duration_unit: :time | :buffers,
  intervals:
    [{Membrane.Time.t(), duration :: Membrane.Time.t() | integer()}]
    | Enumerable.t()
}
```

Struct containing options for `Membrane.Scissors`

# `options`

```elixir
@spec options() :: keyword()
```

Returns description of options available for this module

---

*Consult [api-reference.md](api-reference.md) for complete listing*
