{"id":18352755,"url":"https://github.com/membraneframework/membrane_h264_ffmpeg_plugin","last_synced_at":"2025-12-11T23:52:05.758Z","repository":{"id":37865882,"uuid":"149613847","full_name":"membraneframework/membrane_h264_ffmpeg_plugin","owner":"membraneframework","description":"Membrane H264 decoder and encoder based on FFmpeg and x264","archived":false,"fork":false,"pushed_at":"2024-12-11T11:46:13.000Z","size":3949,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-13T12:49:59.521Z","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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-20T13:29:56.000Z","updated_at":"2024-12-11T11:45:43.000Z","dependencies_parsed_at":"2023-10-02T19:32:31.542Z","dependency_job_id":"af65f154-fc95-4402-8d9c-2f060144aa9d","html_url":"https://github.com/membraneframework/membrane_h264_ffmpeg_plugin","commit_stats":{"total_commits":222,"total_committers":21,"mean_commits":"10.571428571428571","dds":0.7207207207207207,"last_synced_commit":"6ccb8d6654e96f3294b7a1abc335c1d051a0374b"},"previous_names":["membraneframework/membrane-element-ffmpeg-h264"],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/membraneframework/membrane_h264_ffmpeg_plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_h264_ffmpeg_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_h264_ffmpeg_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_h264_ffmpeg_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_h264_ffmpeg_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/membrane_h264_ffmpeg_plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fmembrane_h264_ffmpeg_plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143940,"owners_count":23883067,"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:13.055Z","updated_at":"2025-12-11T23:52:05.752Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Membrane H264 FFmpeg plugin\n\n[![Hex.pm](https://img.shields.io/hexpm/v/membrane_h264_ffmpeg_plugin.svg)](https://hex.pm/packages/membrane_h264_ffmpeg_plugin)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_h264_ffmpeg_plugin/)\n[![CircleCI](https://circleci.com/gh/membraneframework/membrane_h264_ffmpeg_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_h264_ffmpeg_plugin)\n\nThis package provides H264 video decoder and encoder, based on [ffmpeg](https://www.ffmpeg.org)\nand [x264](https://www.videolan.org/developers/x264.html).\n\nIt is a part of the [Membrane Multimedia Framework](https://membraneframework.org)\n\nDocumentation is available at [HexDocs](https://hexdocs.pm/membrane_h264_ffmpeg_plugin/)\n\nNote: `Membrane.H264.FFmpeg.Parser` has been removed. Now you can use our pure Elixir implementation of the H264 parser: [`Membrane.H264.Parser`](https://hexdocs.pm/membrane_h264_plugin/Membrane.H264.Parser.html) from [membrane_h264_plugin](https://github.com/membraneframework/membrane_h264_plugin).\n\n## Installation\n\nAdd the following line to your `deps` in `mix.exs`. Run `mix deps.get`.\n\n```elixir\n{:membrane_h264_ffmpeg_plugin, \"~\u003e 0.32.6\"}\n```\n\nThis package depends on the [ffmpeg](https://www.ffmpeg.org) libraries. 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#### Ubuntu\n\n```bash\nsudo apt-get install libavcodec-dev libavformat-dev libavutil-dev\n```\n\n#### Arch/Manjaro\n\n```bash\npacman -S ffmpeg\n```\n\n#### MacOS\n\n```bash\nbrew install ffmpeg\n```\n\n## Usage Example\n\n### Decoder\n\nThe following pipeline takes 30fps H264 file and decodes it to the raw video.\n\n```elixir\nLogger.configure(level: :info)\n\nMix.install([\n  :membrane_h264_ffmpeg_plugin,\n  :membrane_h264_plugin,\n  :membrane_file_plugin,\n  :req\n])\n\nh264 = Req.get!(\"https://raw.githubusercontent.com/membraneframework/static/gh-pages/samples/ffmpeg-testsrc.h264\").body\nFile.write!(\"input.h264\", h264)\n\ndefmodule Decoding.Pipeline do\n  use Membrane.Pipeline\n\n  @impl true\n  def handle_init(_ctx, _opts) do\n    structure =\n      child(%Membrane.File.Source{chunk_size: 40_960, location: \"input.h264\"})\n      |\u003e child(Membrane.H264.Parser)\n      |\u003e child(Membrane.H264.FFmpeg.Decoder)\n      |\u003e child(%Membrane.File.Sink{location: \"output.raw\"})\n\n    {[spec: structure], %{}}\n  end\nend\n\nMembrane.Pipeline.start_link(Decoding.Pipeline)\n```\n\n### Encoder\n\nThe following pipeline takes 720p raw video file as input and encodes it as H264.\n\n```elixir\ndefmodule Encoding.Pipeline do\n  use Membrane.Pipeline\n\n  @impl true\n  def handle_init(_) do\n    structure =\n      child(:source, %Membrane.File.Source{chunk_size: 40_960, location: \"input.raw\"})\n      |\u003e child(:parser, %Membrane.RawVideo.Parser{width: 1280, height: 720, pixel_format: :I420})\n      |\u003e child(:encoder, %Membrane.H264.FFmpeg.Encoder{preset: :fast, crf: 30})\n      |\u003e child(:sink, %Membrane.File.Sink{location: \"output.h264\"})\n\n    {[spec: structure], %{}}\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_h264_ffmpeg_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fmembrane_h264_ffmpeg_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fmembrane_h264_ffmpeg_plugin/lists"}