Framework
membraneframework/membrane_core avatar
membraneframework/membrane_core

membrane_core for Elixir multimedia pipelines

The core of Membrane Framework, multimedia processing framework written in Elixir

1,520 stars46 forksElixirApache-2.0

At a glance

What is it?
membrane_core provides the pipeline and element model behind Membrane Framework for building audio and video processing applications in Elixir. It is most relevant when a media workflow needs explicit sources, processing stages, and sinks that can evolve beyond a linear playback script.
Who is it for?
Adopt membrane_core when the application needs a modular audio or video topology built in Elixir, especially when sources, processing elements, and sinks should remain independently replaceable. Do not choose it merely to play one local media file, and do not assume that every production protocol is bundled with the core.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Elixir, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The Elixir problem addressed by membrane_core

membrane_core addresses the need to organize continuous multimedia processing as software rather than as one tightly coupled playback or transcoding routine. The README presents Membrane as a framework for building media servers that stream through WebRTC, RTSP, RTMP, HLS, and HTTP; transcode, mix, and customize audio or video; read and record formats including MP4, MKV, and FLV; and connect or disconnect streams dynamically. Those examples point to applications that continually receive data, pass it through several transformations, and deliver it elsewhere.

The intended users are Elixir developers working on media servers, selective forwarding units, recording systems, live pipelines, and custom audio or video processing. They may also be developers who already know a media protocol or codec library but need a consistent Elixir abstraction for composing it with other processing stages. Membrane does not present itself as a single end-user media player. Its center of gravity is pipeline construction.

That distinction matters because the framework is most useful when the topology contains several responsibilities. A source may fetch MP3 data over HTTP, a decoder may convert compressed frames, and a sink may send audio to a sound card. A production topology may instead need protocol input, video and audio processing, multiplexing, and network output. The repository provides the core structure, while separate plugins supply protocol, codec, container, and functionality-specific elements.

Elements and linked pipelines in membrane_core

The basic abstraction described by the README is the Element. An element represents a media-processing responsibility, such as decoding input, muxing audio and video into MP4, or playing raw audio through a sound card. Elements can be supplied by framework packages or implemented by the application. That extension point is central to the design because custom processing can appear as another stage rather than requiring a rewritten transport path.

Elements are organized into a pipeline, which the documentation describes as a sequence of linked elements. In the quick start, `Membrane.Pipeline` is used as the application module, and `handle_init/2` receives the MP3 URL as initialization input. The pipeline specification is assembled with `child/2`. `Membrane.Hackney.Source` is attached to `Membrane.MP3.MAD.Decoder`, and the decoder is attached to `Membrane.PortAudio.Sink`.

The visible data flow is therefore HTTP retrieval, MP3 decoding, then speaker output. Each module has a narrower role than the pipeline. That separation allows another sink or processing element to replace part of the chain, subject to the available plugins and the formats or stream types they accept. The README also says pipelines can handle dynamically connecting and disconnecting streams and can recover from errors. It does not provide timing, retry, backpressure, or failure-policy details in the visible text, so those aspects need confirmation in the API documentation before they are treated as guarantees for a particular topology.

Running the documented MP3-to-speaker pipeline

The quickest documented route uses the repository's Livebook rather than requiring readers to assemble a Mix project first. Open the `example.livemd` file through its Livebook link, allow Livebook to install, and click the run control described by the README. The example should download the sample MP3, decode it, and play audio through PortAudio. Speaker output is the expected result, but audio device availability and permissions are environmental concerns not addressed by the visible documentation.

For a shell-oriented route, the README instructs readers to install Elixir, start its interactive shell, and paste the quick-start snippet. The only command needed to begin that shell is:

bash
iex

The snippet then calls `Mix.install/1` for `membrane_hackney_plugin`, `membrane_mp3_mad_plugin`, and `membrane_portaudio_plugin`. It defines `MyPipeline`, starts it with `Membrane.Pipeline.start_link/2`, and passes the sample MP3 URL. Those steps are defined in the README rather than reconstructed from an unstated package workflow.

This example is a genuine pipeline rather than a direct decoder call. It also reveals the dependency boundary. `membrane_core` supplies the core model, while the quick start needs three plugin packages for HTTP input, MP3 decoding, and PortAudio output. If the goal is a network media server, those exact plugins would not be sufficient by themselves. A relevant question for evaluation is which plugins will provide the required protocol, codec, and container support.

Plugin boundaries and custom element expansion

Membrane is distributed across multiple packages, including plugins, formats, core, and standalone libraries. Plugin repositories follow names such as `membrane_X_plugin`, where X can represent a protocol, codec, container, or functionality. The README also describes wrappers around existing tools or libraries, such as `membrane_X_LIBRARYNAME_plugin` or `membrane_LIBRARYNAME_plugin`.

This packaging changes the adoption calculation. The framework is not one repository that necessarily supplies every demuxer, decoder, protocol implementation, and output target. Engineers must map their media requirements to separate packages and verify compatibility among them. The visible quick start demonstrates that even a three-stage MP3 pipeline requires three named plugins alongside the core.

Custom elements provide the other route. Because an element can represent a processing operation, application code can be inserted into a pipeline where suitable inputs and outputs exist. The README says custom processing can be plugged in at almost any point, but it does not claim that arbitrary processing can be inserted without regard to stream type or timing. A custom filter that consumes decoded audio, for example, cannot be treated as interchangeable with one that expects compressed MP3 data.

This design is useful when the unique business logic is a filter, analyzer, mixer stage, or transformation not available in an existing plugin. It is less convenient when the immediate requirement is a single command-line conversion. In that case, the plugin resolution and element topology can be more structure than the task needs.

Dynamic topology claims and undocumented controls

Dynamic stream connections, disconnections, scaling, and error recovery are among the main capabilities claimed for Membrane. These claims make the framework relevant to long-running services rather than only scripts that process one file from start to finish. The architecture of linked elements provides a plausible place for these behaviors, but the visible README does not explain the APIs or policies that implement them.

The absence is a real adoption limitation. There is no documented answer here for how many elements a pipeline may contain, how quickly a failed source retries, whether decoder errors can be isolated per stream, or how backpressure propagates across a long chain. There is also no documented rollout procedure for changing a live pipeline. Those details affect the operational contract of a media server and should not be inferred from the phrase that the framework can recover from errors.

The architecture is a better fit when changing inputs, outputs, or processing stages is a normal requirement. It is the wrong level of abstraction when a known external tool already provides a fixed conversion and the application only needs to invoke it. A direct integration has fewer Membrane-specific concepts, but it also does not supply the same element model for composing several independently replaceable stages.

Membrane pipelines versus direct library integration

A concrete alternative is to build the media workflow directly in Elixir around the specific codec, container, and protocol libraries required by the application. The difference is architectural rather than cosmetic. Direct integration puts fetching, decoding, processing, and output handling in application code or a smaller abstraction chosen for that job. Membrane instead defines those roles as elements connected through a common pipeline model.

Choose direct integration when there is one stable transformation, the underlying library already exposes a complete interface, and composition across protocols is unnecessary. It reduces the number of Membrane packages and element contracts involved. The trade-off is that custom connections, multiple streams, or inserted processing stages remain the application's responsibility.

Choose membrane_core when several media roles need to be composed, when sources and sinks may change, or when the application wants custom Elixir code to participate as a pipeline element. The core's value is not merely that it can decode MP3. It is the shared model that lets HTTP, RTSP, HLS, recording, muxing, and custom processing appear as parts of one topology. The repository does not claim that every listed protocol or format is included here, so package availability remains part of that decision.

Maintenance evidence, releases, and Apache-2.0

The repository is not archived, and its last push was on 2026-10-15. Recent releases include `v1.3.4` on 2026-06-22, `v1.3.3` on 2026-06-02, and `v1.3.2` on 2026-05-26. This establishes recent repository and release activity. It does not establish compatibility between every core release and every separately distributed plugin, so an adoption plan still needs to account for package versions.

The documented learning resources include the `membrane.stream/learn` website, the `membrane_demo` repository, and the structured `skills/membrane-framework/SKILL.md` file. The README also points contributors to `CONTRIBUTING.md`, while the repository includes `CHANGELOG.md`, tests, configuration, and formatter settings. Those files indicate where behavior changes and contribution guidance are recorded, although the visible excerpt does not summarize their contents.

The project uses the Apache-2.0 license. Engineers should review the repository's `LICENSE` and `NOTICE` handling, dependency licenses, and any plugin licenses relevant to their distribution. That is a compliance step rather than legal advice. The visible README does not document a stable upgrade policy or a formal compatibility matrix, making dependency review a specific part of the upgrade cost.

Editorial conclusion

Adopt membrane_core when the application needs a modular audio or video topology built in Elixir, especially when sources, processing elements, and sinks should remain independently replaceable. Do not choose it merely to play one local media file, and do not assume that every production protocol is bundled with the core. Verify first that the required source, decoder, sink, container, and protocol plugins exist, then check whether the documented error handling and dynamic topology behavior match the intended media server.

Frequently asked questions

What is membrane_core used for?

It is the core of Membrane Framework, an Elixir multimedia framework for composing audio and video elements into pipelines. The README lists streaming, transcoding, mixing, custom processing, recording, and dynamic stream handling among its target use cases.

How do I run the first membrane_core example?

Open `example.livemd` through the README's Livebook link and click the run control, or install Elixir, start `iex`, and paste the documented quick-start snippet. The example installs the Hackney, MP3 MAD, and PortAudio plugins before starting an HTTP MP3 playback pipeline.

Does membrane_core include every audio and video plugin?

No. The README says Membrane is delivered through multiple packages, and its quick start needs `membrane_hackney_plugin`, `membrane_mp3_mad_plugin`, and `membrane_portaudio_plugin`. Required protocol, codec, and container support may therefore involve separate plugin repositories.

Official sources

  1. License: Apache-2.0
  2. membraneframework/membrane_core on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/membraneframework-membrane-core.svg)](https://hysenlabs.com/projects/membraneframework-membrane-core)

Was this useful?