{"id":18352802,"url":"https://github.com/membraneframework/membrane_opus_plugin","last_synced_at":"2025-04-06T11:33:07.309Z","repository":{"id":39995901,"uuid":"80109961","full_name":"membraneframework/membrane_opus_plugin","owner":"membraneframework","description":"Membrane Opus encoder and decoder","archived":false,"fork":false,"pushed_at":"2025-01-10T09:03:20.000Z","size":39915,"stargazers_count":6,"open_issues_count":0,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-21T22:33:46.755Z","etag":null,"topics":["decoder","encoder","membrane","opus"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/membraneframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-26T11:44:37.000Z","updated_at":"2025-01-10T10:44:06.000Z","dependencies_parsed_at":"2023-01-24T17:45:46.481Z","dependency_job_id":"8e92fe40-0942-4042-a615-41a038bbece9","html_url":"https://github.com/membraneframework/membrane_opus_plugin","commit_stats":{"total_commits":169,"total_committers":19,"mean_commits":8.894736842105264,"dds":0.7514792899408285,"last_synced_commit":"4cd1bdb3480efd28411af76af89d85fdb636017e"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_opus_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_opus_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_opus_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_opus_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/membrane_opus_plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478152,"owners_count":20945258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decoder","encoder","membrane","opus"],"created_at":"2024-11-05T21:37:26.735Z","updated_at":"2025-04-06T11:33:07.303Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Membrane Opus plugin\n\n[![Hex.pm](https://img.shields.io/hexpm/v/membrane_opus_plugin.svg)](https://hex.pm/packages/membrane_opus_plugin)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_opus_plugin/)\n[![CircleCI](https://circleci.com/gh/membraneframework/membrane_opus_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_opus_plugin)\n\nOpus encoder and decoder.\n\nIt is a part of [Membrane Multimedia Framework](https://membrane.stream).\n\n## Installation\n\nThe package can be installed by adding `membrane_opus_plugin` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:membrane_opus_plugin, \"~\u003e 0.20.5\"}\n  ]\nend\n```\n\nThis package depends on [libopus](http://opus-codec.org/docs/) library. The precompiled builds will be pulled and linked automatically. However, should there be any problems, consider installing it manually.\n\n### Manual instalation of dependencies\n\n#### Ubuntu\n```\nsudo apt-get install libopus-dev\n```\n\n#### Arch/Manjaro\n```\npacman -S opus\n```\n\n#### MacOS\n```\nbrew install opus\n```\n\n#### MacOS M1/M2 (Apple silicon)\n\nOn Apple M1/M2 chips, one needs to export variables:\n```\nexport C_INCLUDE_PATH=$C_INCLUDE_PATH:$(brew --cellar)/opus/1.3.1/include\nexport LIBRARY_PATH=$LIBRARY_PATH:$(brew --cellar)/opus/1.3.1/lib\n```\nOn different local setups, directory and version names may differ.\n\n## Usage\n\n### Encoder\n\nThe pipeline encodes a sample raw file and saves it as an opus file:\n\n```elixir\ndefmodule Membrane.ReleaseTest.Pipeline do\n  use Membrane.Pipeline\n  alias Membrane.RawAudio\n\n  @input_filename \"/tmp/input.raw\"\n  @output_filename \"/tmp/output.opus\"\n\n  @impl true\n  def handle_init(_ctx, _options) do\n    structure = \n      child(:source, %Membrane.File.Source{\n        location: @input_filename\n      })\n      |\u003e child(:encoder, %Membrane.Opus.Encoder{\n        application: :audio,\n        input_stream_format: %RawAudio{\n          channels: 2,\n          sample_format: :s16le,\n          sample_rate: 48_000\n        }\n      })\n      |\u003e child(:parser, %Membrane.Opus.Parser{delimitation: :delimit})\n      |\u003e child(:sink, %Membrane.File.Sink{\n        location: @output_filename\n      })\n\n    {[spec: structure], %{}}\n  end\nend\n```\n\nOpus audio generally needs to be packaged in an [Ogg container](https://xiph.org/ogg/) in order to be played by a\nmedia player. See `Membrane.Ogg.Payloader` in the [Membrane Ogg Plugin](https://github.com/membraneframework/membrane_ogg_plugin).\n\n\n### Decoder\n\nThe pipeline parses, decodes a sample opus file and then saves it as a raw file:\n\n```elixir\ndefmodule Membrane.ReleaseTest.Pipeline2 do\n  use Membrane.Pipeline\n\n  @input_filename \"/tmp/input.raw\"\n  @output_filename \"/tmp/output.opus\"\n\n  @impl true\n  def handle_init(_ctx, _options) do\n    structure = \n      child(:source, %Membrane.File.Source{\n        location: @input_filename\n      })\n      |\u003e child(:parser, Membrane.Opus.Parser)\n      |\u003e child(:opus, Membrane.Opus.Decoder)\n      |\u003e child(:sink, %Membrane.File.Sink{\n        location: @output_filename\n      })\n\n    {[spec: structure], %{}}\n  end\nend\n```\n\n## Copyright and License\n\nCopyright 2019, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane_opus_plugin)\n\n[![Software Mansion](https://logo.swmansion.com/logo?color=white\u0026variant=desktop\u0026width=200\u0026tag=membrane-github)](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane_opus_plugin)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_opus_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fmembrane_opus_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_opus_plugin/lists"}