{"id":18352734,"url":"https://github.com/membraneframework/membrane_video_merger_plugin","last_synced_at":"2026-02-10T13:34:02.792Z","repository":{"id":40470507,"uuid":"375276349","full_name":"membraneframework/membrane_video_merger_plugin","owner":"membraneframework","description":"Membrane raw video cutter, merger and cut \u0026 merge bin","archived":false,"fork":false,"pushed_at":"2024-07-08T15:03:12.000Z","size":336,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T06:42:49.410Z","etag":null,"topics":["elixir","membrane","membrane-framework","multimedia","streaming-video","video"],"latest_commit_sha":null,"homepage":"https://membraneframework.org","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}},"created_at":"2021-06-09T08:07:17.000Z","updated_at":"2024-07-04T10:49:41.000Z","dependencies_parsed_at":"2023-02-09T03:15:55.321Z","dependency_job_id":"2457209d-2974-4ebe-b535-eb8fe5e61cc1","html_url":"https://github.com/membraneframework/membrane_video_merger_plugin","commit_stats":{"total_commits":69,"total_committers":8,"mean_commits":8.625,"dds":0.6086956521739131,"last_synced_commit":"8435ff767288afd7c2ba52058e21390f8ee31fb3"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":"membraneframework/membrane_template_plugin","purl":"pkg:github/membraneframework/membrane_video_merger_plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_video_merger_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_video_merger_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_video_merger_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_video_merger_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/membrane_video_merger_plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_video_merger_plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29300817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T12:55:56.056Z","status":"ssl_error","status_checked_at":"2026-02-10T12:55:55.692Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["elixir","membrane","membrane-framework","multimedia","streaming-video","video"],"created_at":"2024-11-05T21:37:06.570Z","updated_at":"2026-02-10T13:34:02.777Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Membrane VideoMerger Plugin\n\n[![Hex.pm](https://img.shields.io/hexpm/v/membrane_video_merger_plugin.svg)](https://hex.pm/packages/membrane_video_merger_plugin)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_video_merger_plugin)\n[![CircleCI](https://circleci.com/gh/membraneframework/membrane_video_merger_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_video_merger_plugin)\n\nPlugin containing elements for cutting and merging raw video. By using this plugin you can\n  - simply merge multiple video tracks (`VideoMerger`)\n  - cut out specific intervals of video track (`VideoCutter`)\n  - combine chosen parts raw video tracks into one (`VideoCutAndMerge`), for instance by taking\n  the first half of one track and combining it with the second half of another\n\nFor most cases, the `VideoCutAndMerge` bin should be your first choice.\n\nImplementations of the `VideoCutter` and the `VideoMerger` are using presentation timestamps,\nso every `Buffer` should have the `pts` field set.\n\nIt is part of [Membrane Multimedia Framework](https://membraneframework.org).\n\n## Installation\n\nThe package can be installed by adding `membrane_video_merger_plugin` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:membrane_video_merger_plugin, \"~\u003e 0.9.1\"}\n  ]\nend\n```\n\n## Sample Usage\n\nBoth pipelines will result in creating `/tmp/output.raw` file with the first 5 seconds of the\n`input_1` track and everything but the first 5 seconds of the `input_2` track.\n\n`/tmp/input_1.h264` and `/tmp/input_2.h264` should be an H264 video files.\n\n### CutAndMerge bin\n\n```elixir\ndefmodule VideoCutAndMerge.Pipeline do\n  use Membrane.Pipeline\n\n  alias Membrane.VideoCutAndMerge\n  alias Membrane.H264.FFmpeg.{Parser, Decoder}\n  alias Membrane.File.{Sink, Source}\n\n  @impl true\n  def handle_init(_ctx, _options) do\n    stream_1 = %VideoCutAndMerge.Stream{intervals: [{0, Membrane.Time.seconds(5)}]}\n    stream_2 = %VideoCutAndMerge.Stream{intervals: [{Membrane.Time.seconds(5), :infinity}]}\n\n    structure = [\n      child(:cut_and_merge, VideoCutAndMerge)\n      |\u003e child(:sink, %Sink{location: \"/tmp/output.raw\"}),\n\n      child({:file_src, 1}, %Source{chunk_size: 40_960, location: \"/tmp/input_1.h264\"})\n      |\u003e child({:parser, 1}, %Parser{framerate: {30, 1}})\n      |\u003e child({:decoder, 1}, Decoder)\n      |\u003e via_in(Pad.ref(:input, 1), options: [stream: stream_1])\n      |\u003e get_child(:cut_and_merge),\n\n      child({:file_src, 2}, %Source{chunk_size: 40_960, location: \"/tmp/input_2.h264\"})\n      |\u003e child({:parser, 2}, %Parser{framerate: {30, 1}})\n      |\u003e child({:decoder, 2}, Decoder)\n      |\u003e via_in(Pad.ref(:input, 2), options: [stream: stream_2])\n      |\u003e get_child(:cut_and_merge)\n    ]\n\n    {[spec: structure], %{}}\n  end\nend\n```\n\n### VideoCutter and VideoMerger\n\n```elixir\ndefmodule VideoMerger.Pipeline do\n  use Membrane.Pipeline\n\n  alias Membrane.H264.FFmpeg.{Parser, Decoder}\n  alias Membrane.File.{Sink, Source}\n  alias Membrane.{VideoCutter, VideoMerger}\n\n  @impl true\n  def handle_init(_ctx, _options) do\n    structure = [\n      child(:merger, VideoMerger)\n      |\u003e child(:sink, %Sink{location: \"/tmp/output.raw\"),\n\n      child({:file_src, 1}, %Source{chunk_size: 40_960, location: \"/tmp/input_1.h264\"})\n      |\u003e child({:parser, 1}, %Parser{framerate: {30, 1}})\n      |\u003e child({:decoder, 1}, Decoder)\n      |\u003e child({:cutter, 1}, %VideoCutter{intervals: [{0, Membrane.Time.seconds(5)}]})\n      |\u003e via_in(Pad.ref(:input, 1))\n      |\u003e get_child(:merger),\n\n      child({:file_src, 2}, %Source{chunk_size: 40_960, location: \"/tmp/input_2.h264\"})\n      |\u003e child({:parser, 2}, %Parser{framerate: {30, 1}})\n      |\u003e child({:decoder, 2}, Decoder)\n      |\u003e child({:cutter, 2}, %VideoCutter{intervals: [{Membrane.Time.seconds(5), :infinity}]})\n      |\u003e via_in(Pad.ref(:input, 2))\n      |\u003e get_child(:merger),\n    ]\n\n    {[spec: structure], %{}}\n  end\nend\n```\n\n## Copyright and License\n\nCopyright 2021, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane_video_merger_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_video_merger_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_video_merger_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fmembrane_video_merger_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_video_merger_plugin/lists"}