Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

membraneframework/membrane_core

Repository files navigation

Hex.pmAPI DocsCircleCI

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,
  • accept and generate / record to MP4, MKV, FLV and other containers,
  • handle dynamically connecting and disconnecting streams,
  • seamlessly scale and recover from errors,
  • do whatever you imagine if you implement it yourself :D Membrane makes it easy to plug in your code at almost any point of processing.

The abbreviations above don't ring any bells? Visitmembrane.stream/learn and let Membrane introduce you to the multimedia world!

If you have questions or need consulting, we're for you at ourDiscord,forum,GitHub discussions,X (Twitter) and viae-mail.

You can alsofollow Membrane on X (Twitter) orjoin our Discord to be up to date and get involved in the community.

Membrane is maintained bySoftware Mansion.

Quick start

Mix.install([:membrane_hackney_plugin,:membrane_mp3_mad_plugin,:membrane_portaudio_plugin,])defmoduleMyPipelinedouseMembrane.Pipeline@impltruedefhandle_init(_ctx,mp3_url)dospec=child(%Membrane.Hackney.Source{location:mp3_url,hackney_opts:[follow_redirect:true]})|>child(Membrane.MP3.MAD.Decoder)|>child(Membrane.PortAudio.Sink){[spec:spec],%{}}endendmp3_url="https://raw.githubusercontent.com/membraneframework/membrane_demo/master/simple_pipeline/sample.mp3"Membrane.Pipeline.start_link(MyPipeline,mp3_url)

This is anElixir 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:

    Run in Livebook

    It will installLivebook, 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 caninstall Elixir, typeiex to run the interactive shell and paste the snippet there.

After that, you should hear music playing on your speaker 🎉

To learn step-by-step what exactly happens here, followthis tutorial.

Learning

The best place to learn Membrane is themembrane.stream/learn website and themembrane_demo repository. Try them out, then hack something exciting!

Structure of the framework

The most basic media processing entities of Membrane areElements. 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. TheQuick start section above shows how to create a simple pipeline.

Membrane packages

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 availablehere.

Plugins

Plugins provide elements that you can use in your pipeline. Each plugin lives in amembrane_X_plugin repository, where X can be a protocol, codec, container or functionality, for examplemembrane_opus_plugin. Plugins wrapping a tool or library are namedmembrane_X_LIBRARYNAME_plugin or justmembrane_LIBRARYNAME_plugin, likemembrane_mp3_mad_plugin. Plugins are published onhex.pm, for examplehex.pm/packages/membrane_opus_plugin and docs are athexdocs, likehexdocs.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 inmembrane_X_format repositories, where X is usually a codec or container, for examplemebrane_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 bymembrane_core. To install it, add the following line to yourdeps inmix.exs and runmix deps.get

{:membrane_core,"~> 1.2"}

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 examplevideo_compositor,ex_sdp orunifex.

Goals

The main goals of Membrane are:

  • To make work with multimedia a more pleasant experience than it is now.
  • To provide a welcoming ecosystem for learning multimedia development.
  • To power resilient, maintainable and scalable systems.

Elixir language

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, trythis tutorial - it shouldn't take long and you'll know more than enough to get started with Membrane.

Contributing

We welcome everyone to contribute to Membrane. Here are some ways to contribute:

  • Spread the word about Membrane! Even though multimedia are present everywhere today, media dev is still quite niche. Let it be no longer!
  • Create learning materials. We try our best but can cover only a limited number of Membrane use cases.
  • Improve docs. We know it's not the most exciting part, but if you had a hard time understanding the docs, you're the best person to fix them ;)
  • Contribute code - plugins, features and bug fixes. It's best to contact us before, so we can provide our help & assistance, and agree on important matters. For details see thecontribution guide.

Support and questions

If you have any questions regarding Membrane Framework or need consulting, feel free to contact us viaDiscord,forum,GitHub discussions,X (Twitter) ore-mail.

All packages

General

PackageDescriptionLinks
membrane_sdkFull power of Membrane in a single packageHex.pmDocs
membrane_coreThe core of the Membrane Framework, advanced multimedia processing frameworkHex.pmDocs
membrane_rtc_engine[Maintainer:fishjam-dev] Customizable Real-time Communication Engine/SFU library focused on WebRTC.Hex.pmDocs
kino_membraneUtilities for introspecting Membrane pipelines in LivebookHex.pmDocs
docker_membrane[Labs] A docker image based on Ubuntu, with Erlang, Elixir and libraries necessary to test and run the Membrane Framework.
membrane_demoExamples of using the Membrane Framework
membrane_tutorialsRepository which contains text and assets used in Membrane Framework tutorials.

Plugins

General purpose

PackageDescriptionLinks
membrane_file_pluginMembrane plugin for reading and writing to filesHex.pmDocs
membrane_hackney_pluginHTTP sink and source based on HackneyHex.pmDocs
membrane_scissors_pluginElement for cutting off parts of the streamHex.pmDocs
membrane_tee_pluginMembrane plugin for splitting data from a single input to multiple outputsHex.pmDocs
membrane_funnel_pluginMembrane plugin for merging multiple input streams into a single outputHex.pmDocs
membrane_realtimer_pluginMembrane element limiting playback speed to realtime, according to buffers' timestampsHex.pmDocs
membrane_stream_pluginPlugin for recording the entire stream sent through Membrane pads into a binary format and replaying itHex.pmDocs
membrane_fake_pluginFake Membrane sinks that drop incoming dataHex.pmDocs
membrane_pcap_plugin[Labs] Membrane PCAP source, capable of reading captured packets in pcap format
membrane_live_framerate_converter_plugin[Maintainer:kim-company] Membrane.Filter that drops or duplicates frames to match a target framerate. Designed for realtime applications
membrane_template_pluginTemplate for Membrane Elements

Streaming protocols

PackageDescriptionLinks
membrane_webrtc_pluginPlugin for streaming via WebRTCHex.pmDocs
membrane_rtmp_pluginRTMP server & clientHex.pmDocs
membrane_http_adaptive_stream_pluginPlugin generating manifests for HLSHex.pmDocs
membrane_ice_plugin[Maintainer:fishjam-dev] Membrane plugin for ICE protocolHex.pmDocs
membrane_udp_pluginMembrane plugin for sending and receiving UDP streamsHex.pmDocs
membrane_tcp_pluginMembrane plugin for sending and receiving TCP streamsHex.pmDocs
membrane_rtp_pluginMembrane bins and elements for sending and receiving RTP/SRTP and RTCP/SRTCP streamsHex.pmDocs
membrane_rtp_h264_pluginMembrane RTP payloader and depayloader for H264Hex.pmDocs
membrane_rtp_vp8_pluginMembrane elements for payloading and depayloading VP8 into RTPHex.pmDocs
membrane_rtp_vp9_plugin[Labs] Membrane elements for payloading and depayloading VP9 into RTP
membrane_rtp_mpegaudio_pluginMembrane RTP MPEG Audio depayloaderHex.pmDocs
membrane_rtp_opus_pluginMembrane RTP payloader and depayloader for OPUS audioHex.pmDocs
membrane_rtp_g711_plugin[Maintainer:fishjam-dev] Membrane RTP payloader and depayloader for G711 audioHex.pmDocs
membrane_quic_plugin[Maintainer:mickel8]
membrane_mpeg_ts_plugin[Maintainer:kim-company] Membrane.Filter that demuxes MPEG-TS streams
membrane_hls_plugin[Maintainer:kim-company] Plugin providing aMembrane.HLS.Source element for HTTP Live Streaming (HLS).

Containers

PackageDescriptionLinks
membrane_mp4_pluginUtilities for MP4 container parsing and serialization and elements for muxing the stream to CMAFHex.pmDocs
membrane_matroska_pluginMatroska muxer and demuxerHex.pmDocs
membrane_flv_pluginMuxer and demuxer elements for FLV formatHex.pmDocs
membrane_ivf_pluginPlugin for converting video stream into IVF formatHex.pmDocs
membrane_ogg_pluginPlugin for depayloading an Ogg file into an Opus streamHex.pmDocs

Audio codecs

PackageDescriptionLinks
membrane_aac_pluginAAC parser and complementary elements for AAC codecHex.pmDocs
membrane_aac_fdk_pluginMembrane AAC decoder and encoder based on FDK libraryHex.pmDocs
membrane_flac_pluginParser for files in FLAC bitstream formatHex.pmDocs
membrane_mp3_lame_pluginMembrane MP3 encoder based on LameHex.pmDocs
membrane_mp3_mad_pluginMembrane MP3 decoder based on MAD.Hex.pmDocs
membrane_opus_pluginMembrane Opus encoder and decoderHex.pmDocs
membrane_wav_pluginPlugin providing elements handling audio in WAV file format.Hex.pmDocs
membrane_g711_plugin[Maintainer:fishjam-dev] Membrane G.711 decoder, encoder and parserHex.pmDocs

Video codecs

PackageDescriptionLinks
membrane_h26x_pluginMembrane h264 and h265 parsersHex.pmDocs
membrane_h264_ffmpeg_pluginMembrane H264 decoder and encoder based on FFmpeg and x264Hex.pmDocs
membrane_vpx_pluginMembrane plugin for decoding and encoding VP8 and VP9 streamsHex.pmDocs
membrane_abr_transcoder_pluginABR (adaptive bitrate) transcoder, that accepts an h.264 video and outputs multiple variants of it with different qualities.Hex.pmDocs
membrane_h265_ffmpeg_plugin[Maintainer:gBillal] Membrane H265 decoder and encoder based on FFmpeg and x265Hex.pmDocs
elixir-turbojpeg[Maintainer:BinaryNoggin] libjpeg-turbo bindings for Elixir
membrane_subtitle_mixer_plugin[Maintainer:kim-company] Membrane.Filter that uses CEA708 to merge subtitles directly in H264 packets.

Raw audio & video

PackageDescriptionLinks
membrane_generator_pluginVideo and audio samples generatorHex.pmDocs

Raw audio

PackageDescriptionLinks
membrane_raw_audio_parser_pluginMembrane element for parsing raw audioHex.pmDocs
membrane_portaudio_pluginRaw audio retriever and player based on PortAudioHex.pmDocs
membrane_audio_mix_pluginPlugin providing an element mixing raw audio frames.Hex.pmDocs
membrane_audio_filler_pluginElement for filling missing buffers in audio streamHex.pmDocs
membrane_ffmpeg_swresample_pluginPlugin performing audio conversion, resampling and channel mixing, using SWResample module of FFmpeg libraryHex.pmDocs
membrane_audiometer_pluginElements for measuring the level of the audio streamHex.pmDocs

Raw video

PackageDescriptionLinks
membrane_raw_video_parser_pluginMembrane plugin for parsing raw video streamsHex.pmDocs
membrane_video_merger_pluginMembrane raw video cutter, merger and cut & merge binHex.pmDocs
membrane_live_compositor_pluginMembrane plugin for video and audio mixing/composingHex.pmDocs
membrane_camera_capture_pluginA set of elements allowing for capturing local media such as camera or microphoneHex.pmDocs
membrane_rpicam_pluginMembrane rpicam pluginHex.pmDocs
membrane_framerate_converter_pluginElement for converting frame rate of raw video streamHex.pmDocs
membrane_sdl_pluginMembrane video player based on SDLHex.pmDocs
membrane_overlay_pluginFilter for applying overlay image or text on top of videoHex.pmDocs
membrane_ffmpeg_swscale_pluginPlugin providing an element scaling raw video frames, using SWScale module of FFmpeg library.Hex.pmDocs
membrane_ffmpeg_video_filter_pluginFFmpeg-based video filtersHex.pmDocs
membrane_video_mixer_plugin[Maintainer:kim-company] Membrane.Filter that mixes a variable number of input videos into one output using ffmpeg filtersHex.pm

External APIs

PackageDescriptionLinks
membrane_aws_plugin[Maintainer:fishjam-dev]
membrane_agora_pluginMembrane Sink for Agora Server GatewayHex.pmDocs
membrane_element_gcloud_speech_to_textMembrane plugin providing speech recognition via Google Cloud Speech-to-Text APIHex.pmDocs
membrane_element_ibm_speech_to_textMembrane plugin providing speech recognition via IBM Cloud Speech-to-Text serviceHex.pmDocs
membrane_s3_plugin[Maintainer:YuzuTen] Membrane framework plugin to support S3 sources/destinationsHex.pmDocs
membrane_transcription[Maintainer:lawik] Prototype transcription for Membrane

Formats

PackageDescriptionLinks
membrane_rtp_formatReal-time Transport Protocol format for Membrane FrameworkHex.pmDocs
membrane_cmaf_formatMembrane description for Common Media Application FormatHex.pmDocs
membrane_matroska_formatMatroska Membrane formatHex.pmDocs
membrane_mp4_formatMPEG-4 container Membrane formatHex.pmDocs
membrane_raw_audio_formatRaw audio format definition for the Membrane Multimedia FrameworkHex.pmDocs
membrane_raw_video_formatMembrane Multimedia Framework: Raw video format definitionHex.pmDocs
membrane_aac_formatAdvanced Audio Codec Membrane formatHex.pmDocs
membrane_opus_formatOpus audio format definition for Membrane FrameworkHex.pmDocs
membrane_flac_formatFLAC audio format description for Membrane FrameworkHex.pmDocs
membrane_mpegaudio_formatMPEG audio format definition for Membrane FrameworkHex.pmDocs
membrane_h264_formatMembrane Multimedia Framework: H264 video format definitionHex.pmDocs
membrane_vp8_formatVP8 Membrane formatHex.pmDocs
membrane_vp9_formatVP9 Membrane formatHex.pmDocs
membrane_g711_format[Maintainer:fishjam-dev] Membrane Multimedia Framework: G711 audio format definitionHex.pmDocs

Standalone media libs

PackageDescriptionLinks
ex_webrtc[Maintainer:elixir-webrtc] An Elixir implementation of the W3C WebRTC APIHex.pmDocs
ex_sdpParser and serializer for Session Description ProtocolHex.pmDocs
ex_libniceLibnice-based Interactive Connectivity Establishment (ICE) protocol support for ElixirHex.pmDocs
ex_libsrtpElixir bindings for libsrtpHex.pmDocs
ex_m3u8Elixir package for serializing and deserializing M3U8 manifests.Hex.pmDocs
membrane_rtspRTSP client for ElixirHex.pmDocs
membrane_ffmpeg_generator[Labs] FFmpeg video and audio generator for tests, benchmarks and demos.Hex.pmDocs

Utils

PackageDescriptionLinks
unifexTool for generating interfaces between native C code and ElixirHex.pmDocs
bundlexMultiplatform app bundler tool for ElixirHex.pmDocs
beamchmarkElixir tool for benchmarking EVM performanceHex.pmDocs
bunchA bunch of helper functions, intended to make life easierHex.pmDocs
bunch_nativeNative part of the Bunch packageHex.pmDocs
shmexElixir bindings for shared memoryHex.pmDocs
membrane_timestamp_queueQueue that aligns streams from multiple sources basing on timestampsHex.pmDocs
membrane_common_cMembrane Multimedia Framework: Common C RoutinesHex.pmDocs
membrane_telemetry_metricsMembrane tool for generating metricsHex.pmDocs
membrane_opentelemetry[Labs] Utilities for using OpenTelemetry with MembraneHex.pmDocs
membrane_precompiled_dependency_providerProvides URLs for precompiled dependencies used by Membrane plugins.Hex.pmDocs

Authors

Membrane Framework is created by Software Mansion.

Since 2012Software Mansion is a software agency with experience in building web and mobile apps as well as complex multimedia solutions. We are Core React Native Contributors and experts in live streaming and broadcasting technologies. We can help you build your next dream product –Hire us.

Copyright 2018,Software Mansion

Software Mansion

Licensed under theApache License, Version 2.0


[8]ページ先頭

©2009-2025 Movatter.jp