View Source Membrane Live Compositor Plugin

Hex.pm API Docs CircleCI

Membrane SDK for LiveCompositor, that takes multiple input streams, transforms them according to provided transformations and composes them into output streams / videos.

It is part of Membrane Multimedia Framework.

Installation

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

def deps do
  [
    {:membrane_live_compositor_plugin, "~> 0.10.0"}
  ]
end

LiveCompositor requires having locally installed:

  • FFmpeg 6.0 - for streaming inputs / outputs to LiveCompositor
  • wget - for downloading LiveCompositor binary file
  • tar - for decompressing LiveCompositor binary file

Examples

Examples can be found in examples directory.

To run example run:

  1. cd examples
  2. mix deps.get
  3. mix run lib/[example_name].exs

Layout with shader example

The example presents dynamically added video arranged onto a tiled layout and "twisted" with the simple shader. Shaders can be used to create custom visual effects.

Transition example

The example presents dynamic transition of input videos. Transitions are used for smooth, dynamical animations.

Dynamic outputs example

The example presents dynamic outputs linking. Multiple outputs are useful for live-streaming for multiple platforms (e.g. different layout for mobile devices), target resolutions or any other case, when user want to process input videos differently.

Offline processing example

Example of processing that does not need to be real time. Multiple offline sources (mp4 files) are composed together and produce output mp4 file. To simplify the example the same input file is read multiple times as a separate inputs. Depending on hardware capabilities this example can run faster or slower than real time.