Membrane is a versatile multimedia streaming & processing framework. You can use it to build a media server of your need, that can: stream via WebRTC, RTSP, RTMP, HLS, HTTP and other protocols, transcode, mix and apply custom processing of video & audio,
> /plugin marketplace add membraneframework/membrane_core> /plugin install membrane-framework@membrane
Repo: membraneframework/membrane_core
What's inside
Membrane is a versatile multimedia streaming & processing framework. You can use it to build a media server of your need, that can:
The abbreviations above don't ring any bells? Visit membrane.stream/learn and let Membrane introduce you to the multimedia world!
If you have questions or need consulting, we're for you at our Discord, forum, GitHub discussions, X (Twitter) and via e-mail.
You can also follow Membrane on X (Twitter) or join our Discord to be up to date and get involved in the community.
If you already had a chance to use Membrane, we will be greateful if could fill out quick survey to help us improve framework and decide on what to do next.
For people who write Membrane code with AI assistants, we ship a dedicated skill for them.
Membrane is maintained by Software Mansion.
Mix.install([
:membrane_hackney_plugin,
:membrane_mp3_mad_plugin,
:membrane_portaudio_plugin,
])
defmodule MyPipeline do
use Membrane.Pipeline
@impl true
def handle_init(_ctx, mp3_url) do
spec =
child(%Membrane.Hackney.Source{
location: mp3_url, hackney_opts: [follow_redirect: true]
})
|> child(Membrane.MP3.MAD.Decoder)
|> child(Membrane.PortAudio.Sink)
{[spec: spec], %{}}
end
end
mp3_url = "https://raw.githubusercontent.com/membraneframework/membrane_demo/master/simple_pipeline/sample.mp3"
Membrane.Pipeline.start_link(MyPipeline, mp3_url)
This is an Elixir snippet, that streams an mp3 via HTTP and plays it on your speaker. Here's how to run it:
Option 1: Click the button below:
It will install Livebook, an interactive notebook similar to Jupyter, and it'll open the snippet in there for you. Then just click the 'run' button in there.
Option 2: If you don't want to use Livebook, you can install Elixir, type iex to run the interactive shell and paste the snippet there.
After that, you should hear music playing on your speaker :tada:
To learn step-by-step what exactly happens here, follow this tutorial.
The best place to learn Membrane is the membrane.stream/learn website and the membrane_demo repository. Try them out, then hack something exciting!
This repo includes skills/membrane-framework/SKILL.md, a structured guide that helps AI coding assistants write Membrane code.
If you use Claude Code, install it via the plugin system:
/plugin marketplace add membraneframework/membrane_core
/plugin install membrane-framework@membrane
After install, Claude automatically pulls in the skill whenever you work on Membrane code (mentioning Membrane.Pipeline, Bin, Filter, Pad, etc).
If you use Cursor, drop the skill into your project's rules directory:
mkdir -p .cursor/rules && curl -fL https://raw.githubusercontent.com/membraneframework/membrane_core/master/skills/membrane-framework/SKILL.md -o .cursor/rules/membrane-framework.mdc
For a cross-agent install, use skills.sh's CLI via npx:
npx skills add membraneframework/membrane_core -g
For agents skills.sh doesn't support, include the SKILL.md file directly in the agent's context, or copy its contents into whatever instruction file the tool reads.
The most basic media processing entities of Membrane are Elements. An element might be able, for example, to mux incoming audio and video streams into MP4, or play raw audio using your sound card. You can create elements yourself, or choose from the ones provided by the framework.
Elements can be organized into a pipeline - a sequence of linked elements that perform a specific task. For example, a pipeline might receive an incoming RTSP stream from a webcam and convert it to an HLS stream, or act as a selective forwarding unit (SFU) to implement your own videoconferencing room. The Quick start section above shows how to create a simple pipeline.
To embrace modularity, Membrane is delivered to you in multiple packages, including plugins, formats, core and standalone libraries. The complete list of all the Membrane packages maintained by the Membrane team is available here.
Plugins
Plugins provide elements that you can use in your pipeline. Each plugin lives in a membrane_X_plugin repository, where X can be a protocol, codec, container or functionality, for example membrane_opus_plugin. Plugins wrapping a tool or library are named membrane_X_LIBRARYNAME_plugin or just membrane_LIBRARYNAME_plugin, like membrane_mp3_mad_plugin. Plugins are published on hex.pm, for example hex.pm/packages/membrane_opus_plugin and docs are at hexdocs, like hexdocs.pm/membrane_opus_plugin. Some plugins require native libraries installed in your OS. Those requirements, along with usage examples are outlined in each plugin's readme.
Formats
Apart from plugins, Membrane has stream formats, which live in membrane_X_format repositories, where X is usually a codec or container, for example membrane_opus_format. Stream formats are published the same way as packages and are used by elements to define what kind of stream can be sent or received. They also provide utility functions to deal with a given codec/container.
Core
The API for creating pipelines (and custom elements too) is provided by membrane_core. To install it, add the following line to your deps in mix.exs and run mix deps.get
{:membrane_core, "~> 1.3"}
Standalone libraries
Last but not least, Membrane provides tools and libraries that can be used standalone and don't depend on the membrane_core, for example video_compositor, ex_sdp or unifex.
The main goals of Membrane are:
We chose Elixir for Membrane because it's a modern, high-level, easy-to-learn language, that lets us rapidly develop media solutions. Elixir's main selling points are built-in parallelism and fault-tolerance features, so we can build scalable systems that are self-healing. It also runs on the battle-tested BEAM VM, that's been widely used and actively developed since the '80s. When we need the performance of a low-level language, we delegate to Rust or C.
If you don't know Elixir, try this tutorial - it shouldn't take long and you'll know more than enough to get started with Membrane.
Membrane was created and is being worked on mainly with UNIX-based operating systems in mind - in most cases that means MacOS and Linux. When it comes to Windows, if a project uses any native code, not just pure Elixir, we can't guarantee it works correctly. To use Membrane on Windows we strongly recommend using WSL (Windows Subsystem for Linux), which allows for running a Linux environment on a Windows machine. If you wish to get more insight into direct support for Windows, see this discussion.
We welcome everyone to contribute to Membrane. Here are some ways to contribute:
If you have any questions regarding Membrane Framework or need consulting, feel free to contact us via Discord, forum, GitHub discussions, X (Twitter) or e-mail.
| Package | Description | Links |
|---|---|---|
| membrane_sdk | Full power of Membrane in a single package |
FAQ
membrane-framework is a Claude Code plugin with 1 hand-picked skill for backend work, indexed on Flowy. Install it with the command on its page. It includes membrane-framework. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it