{"id":18352780,"url":"https://github.com/membraneframework/boombox","last_synced_at":"2025-05-16T10:08:32.376Z","repository":{"id":255479131,"uuid":"750430213","full_name":"membraneframework/boombox","owner":"membraneframework","description":"Boombox is a simple streaming tool built on top of Membrane","archived":false,"fork":false,"pushed_at":"2025-05-15T14:44:08.000Z","size":15091,"stargazers_count":180,"open_issues_count":15,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-16T10:08:22.791Z","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-30T16:24:18.000Z","updated_at":"2025-05-15T14:44:16.000Z","dependencies_parsed_at":"2024-09-05T17:30:48.581Z","dependency_job_id":"1bd4fad4-68c2-49dd-85cc-9b689dbb0c34","html_url":"https://github.com/membraneframework/boombox","commit_stats":null,"previous_names":["membraneframework-labs/boombox","membraneframework/boombox"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fboombox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fboombox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fboombox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fboombox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/boombox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509477,"owners_count":22082892,"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:25.337Z","updated_at":"2025-05-16T10:08:27.368Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":["Products and libraries"],"sub_categories":[],"readme":"![boombox_transaprent](https://github.com/user-attachments/assets/1c5f25a2-cc27-4349-ae72-91315d43d6a1)\n\n[![Hex.pm](https://img.shields.io/hexpm/v/boombox.svg)](https://hex.pm/packages/boombox)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/boombox)\n[![CircleCI](https://circleci.com/gh/membraneframework/boombox.svg?style=svg)](https://circleci.com/gh/membraneframework/boombox)\n\nBoombox is a high-level tool for audio \u0026 video streaming tool based on the [Membrane Framework](https://membrane.stream).\n\nSee [examples.livemd](examples.livemd) for examples.\n\n## Usage\n\nThe code below receives a stream via RTMP and sends it over HLS:\n\n```elixir\nBoombox.run(input: \"rtmp://localhost:5432\", output: \"index.m3u8\")\n```\n\nyou can use CLI interface too:\n\n```sh\nboombox -i \"rtmp://localhost:5432\" -o \"index.m3u8\"\n```\n\nAnd the code below generates a video with bouncing Membrane logo and sends it over WebRTC:\n\n```elixir\nMix.install([:boombox, :req, :image])\n\noverlay =\n  Req.get!(\"https://avatars.githubusercontent.com/u/25247695?s=200\u0026v=4\").body\n  |\u003e Vix.Vips.Image.new_from_buffer()\n  |\u003e then(fn {:ok, img} -\u003e img end)\n  |\u003e Image.trim!()\n  |\u003e Image.thumbnail!(100)\n\nbg = Image.new!(640, 480, color: :light_gray)\nmax_x = Image.width(bg) - Image.width(overlay)\nmax_y = Image.height(bg) - Image.height(overlay)\n\nStream.iterate({_x = 300, _y = 0, _dx = 1, _dy = 2, _pts = 0}, fn {x, y, dx, dy, pts} -\u003e\n  dx = if (x + dx) in 0..max_x, do: dx, else: -dx\n  dy = if (y + dy) in 0..max_y, do: dy, else: -dy\n  pts = pts + div(Membrane.Time.seconds(1), _fps = 60)\n  {x + dx, y + dy, dx, dy, pts}\nend)\n|\u003e Stream.map(fn {x, y, _dx, _dy, pts} -\u003e\n  img = Image.compose!(bg, overlay, x: x, y: y)\n  %Boombox.Packet{kind: :video, payload: img, pts: pts}\nend)\n|\u003e Boombox.run(\n  input: {:stream, video: :image, audio: false},\n  output: {:webrtc, \"ws://localhost:8830\"}\n)\n```\n\nTo receive WebRTC/HLS from boombox in a browser or send WebRTC from a browser to boombox\nyou can use simple HTML examples in the `boombox_examples_data` folder, for example\n\n```sh\nwget https://raw.githubusercontent.com/membraneframework/boombox/v0.1.0/boombox_examples_data/webrtc_to_browser.html\nopen webrtc_to_browser.html\n```\n\nFor more examples, see [examples.livemd](examples.livemd).\n\n## Supported formats \u0026 protocols\n\n| format | input | output |\n|---|---|---|\n| MP4 | `\"*.mp4\"` | `\"*.mp4\"` |\n| WebRTC | `{:webrtc, signaling}` | `{:webrtc, signaling}` |\n| WHIP | `{:whip, \"http://*\", token: \"token\"}` | `{:whip, \"http://*\", token: \"token\"}` |\n| RTMP | `\"rtmp://*\"` | _not supported_ |\n| RTSP | `\"rtsp://*\"` | _not supported_ |\n| RTP | `{:rtp, opts}` | _not yet supported_ |\n| HLS | _not supported_ | `\"*.m3u8\"` |\n| `Enumerable.t()` | `{:stream, opts}` | `{:stream, opts}` |\n\nFor the full list of input and output options, see [`Boombox.run/2`](https://hexdocs.pm/boombox/Boombox.html#run/2)\n\n## Installation\n\nTo use Boombox as an Elixir library, add\n\n```elixir\n{:boombox, \"~\u003e 0.1.0\"}\n```\n\nto your dependencies or `Mix.install`.\n\nto use via CLI, run the following:\n\n```sh\nwget https://raw.githubusercontent.com/membraneframework/boombox/v0.1.0/bin/boombox\nchmod u+x boombox\n./boombox\n```\n\nMake sure you have [Elixir](https://elixir-lang.org/) installed. The first call to `boombox` will install it in a default directory in the system. The directory can be set with `MIX_INSTALL_DIR` env variable if preferred.\n\n## CLI\n\nThe CLI API is a direct mapping of the Elixir API:\n  * `:input` and `:output` options of `Boombox.run/2` are mapped to `-i` and `-o` CLI arguments respectively.\n  * Option names, like `:some_option`, are mapped to CLI arguments by removing the colon, adding a leading double hyphen and replacing all underscores with hyphens, like `--some-option`.\n  * Option values mappings depend on the option's type:\n    - String values, like `\"some_value\"`, are mapped to CLI arguments by stripping the quotes, like `some_value`.\n    - Atom values, like `:some_value`, are mapped to CLI arguments by stripping the leading colon, like `some_value`.\n    - Integer values are identical in elixir and CLI.\n    - Binary values, like `\u003c\u003c161, 63\u003e\u003e`, are represented in CLI as their representation in base 16, like `a13f`.\n\nFor example:\n\n```elixir\nBoombox.run(input: \"file.mp4\", output: {:whip, \"http://localhost:3721\", token: \"token\"})\nBoombox.run(\n  input:\n    {:rtp,\n     port: 50001,\n     audio_encoding: :AAC,\n     audio_specific_config: \u003c\u003c161, 63\u003e\u003e,\n     aac_bitrate_mode: :hbr},\n  output: \"index.m3u8\"\n)\n```\n\nare equivalent to:\n\n```sh\n./boombox -i file.mp4 -o --whip http://localhost:3721 --token token\n./boombox -i --rtp --port 50001 --audio-encoding AAC --audio-specific-config a13f --aac-bitrate-mode hbr -o index.m3u8\n```\n\nIt's also possible to pass an `.exs` script:\n\n```sh\n./boombox -s script.exs\n```\n\nIn the script you can call `Boombox.run(...)` and execute other Elixir code.\n\nThe first run of the CLI may take longer than usual, as the necessary artifacts are installed in the system.\n\n## Authors\n\nBoombox is created by Software Mansion.\n\nSince 2012 [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=boombox) 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](https://swmansion.com/contact/projects).\n\nCopyright 2024, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=boombox)\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=boombox)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fboombox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fboombox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fboombox/lists"}