{"id":18352808,"url":"https://github.com/membraneframework/membrane_ffmpeg_swresample_plugin","last_synced_at":"2025-12-11T23:47:06.573Z","repository":{"id":39995851,"uuid":"88238464","full_name":"membraneframework/membrane_ffmpeg_swresample_plugin","owner":"membraneframework","description":"Plugin performing audio conversion, resampling and channel mixing, using SWResample module of FFmpeg library","archived":false,"fork":false,"pushed_at":"2024-04-03T12:40:22.000Z","size":463,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-04T14:07:46.690Z","etag":null,"topics":[],"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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-14T06:09:33.000Z","updated_at":"2024-04-19T12:41:53.160Z","dependencies_parsed_at":"2023-07-17T08:41:04.059Z","dependency_job_id":"ec30db77-521f-45d8-8b8f-5b33ecdfc882","html_url":"https://github.com/membraneframework/membrane_ffmpeg_swresample_plugin","commit_stats":{"total_commits":124,"total_committers":12,"mean_commits":"10.333333333333334","dds":0.6048387096774194,"last_synced_commit":"65bbf7018c5fda21f86691466b92001e783a30fc"},"previous_names":["membraneframework/membrane-element-ffmpeg-swresample"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_ffmpeg_swresample_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_ffmpeg_swresample_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_ffmpeg_swresample_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_ffmpeg_swresample_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/membrane_ffmpeg_swresample_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":[],"created_at":"2024-11-05T21:37:28.394Z","updated_at":"2025-12-11T23:47:06.568Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Membrane FFmpeg SWResample plugin\n\n[![Hex.pm](https://img.shields.io/hexpm/v/membrane_ffmpeg_swresample_plugin.svg)](https://hex.pm/packages/membrane_ffmpeg_swresample_plugin)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_ffmpeg_swresample_plugin/)\n[![CircleCI](https://circleci.com/gh/membraneframework/membrane_ffmpeg_swresample_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_ffmpeg_swresample_plugin)\n\nPlugin performing audio conversion, resampling and channel mixing, using SWResample module of [FFmpeg](https://www.ffmpeg.org/) library.\n\nIt is a part of [Membrane Multimedia Framework](https://membrane.stream).\n\n## Installation\n\nAdd the following line to your `deps` in `mix.exs`. Run `mix deps.get`.\n\n```elixir\n{:membrane_ffmpeg_swresample_plugin, \"~\u003e 0.20.3\"}\n```\n\nThe precompiled builds of the [ffmpeg](https://www.ffmpeg.org) will be pulled and linked automatically. However, should there be any problems, consider installing it manually.\n\n### Manual instalation of dependencies\n\n#### macOS\n\n```shell\nbrew install ffmpeg\n```\n\n#### Ubuntu\n\n```shell\nsudo apt-get install ffmpeg\n```\n\n#### Arch / Manjaro\n\n```shell\npacman -S ffmpeg\n```\n\n## Usage\n\nThe pipeline takes raw audio, converts the sample format from `s24le` to `f32le` and resamples\nit to 44.1 kHz rate.\n\n```elixir\ndefmodule Resampling.Pipeline do\n  use Membrane.Pipeline\n\n  alias Membrane.FFmpeg.SWResample.Converter\n  alias Membrane.{File, RawAudio}\n\n  @impl true\n  def handle_init(_ctx, _opts) do\n    structure = [\n      child(:file_src, %File.Source{location: \"/tmp/input.raw\"})\n      |\u003e child(:converter, %Converter{\n        input_stream_format: %RawAudio{channels: 2, sample_format: :s24le, sample_rate: 48_000},\n        output_stream_format: %RawAudio{channels: 2, sample_format: :f32le, sample_rate: 44_100}\n      })\n      |\u003e child(:file_sink, %File.Sink{location: \"/tmp/output.raw\"})\n    ]\n\n    {[spec: structure, playback: :playing], nil}\n  end\n\n  @impl true\n  def handle_element_end_of_stream(:file_sink, _pad, _ctx_, _state) do\n    {[playback: :stopped], nil}\n  end\nend\n```\n\n## Copyright and License\n\nCopyright 2018, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane)\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)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_ffmpeg_swresample_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fmembrane_ffmpeg_swresample_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_ffmpeg_swresample_plugin/lists"}