Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/membraneframework/membrane_h26x_plugin
Membrane h264 and h265 parsers
https://github.com/membraneframework/membrane_h26x_plugin
Last synced: 2 days ago
JSON representation
Membrane h264 and h265 parsers
- Host: GitHub
- URL: https://github.com/membraneframework/membrane_h26x_plugin
- Owner: membraneframework
- License: apache-2.0
- Created: 2022-06-24T09:08:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-01T14:20:28.000Z (4 months ago)
- Last Synced: 2024-10-29T03:07:34.956Z (10 days ago)
- Language: Elixir
- Homepage:
- Size: 11.3 MB
- Stars: 13
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Membrane H26x Plugin
[![Hex.pm](https://img.shields.io/hexpm/v/membrane_h264_plugin.svg)](https://hex.pm/packages/membrane_h264_plugin)
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_h264_plugin)
[![CircleCI](https://circleci.com/gh/membraneframework/membrane_h264_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_h264_plugin)Membrane H.264 and H.265 parsers.
It is a pair of Membrane elements responsible for parsing the incoming H.264 and H.265 streams. The parsing is done as a sequence of the following steps:
* splitting the stream into stream NAL units
* Parsing the NAL unit headers, so that to read the type of the NAL unit
* Parsing the NAL unit body with the appropriate scheme, based on the NAL unit type read in the step before
* Aggregating the NAL units into a stream of *access units*The output of the element is the incoming binary payload, enriched with the metadata describing the division of the payload into *access units*.
It is part of [Membrane Multimedia Framework](https://membraneframework.org).
## Installation
The package can be installed by adding `membrane_h26x_plugin` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:membrane_h26x_plugin, "~> 0.10.2"}
]
end
```## Usage
The following pipeline takes H264 file, parses it, and then decodes it to the raw video.
```elixir
defmodule Decoding.Pipeline do
use Membrane.Pipelinealias Membrane.{File, H264}
@impl true
def handle_init(_ctx, _opts) do
spec =
child(:source, %File.Source{location: "test/fixtures/input-10-720p-main.h264"})
|> child(:parser, H264.Parser)
|> child(:decoder, H264.FFmpeg.Decoder)
|> child(:sink, %File.Sink{location: "output.raw"}){[spec: spec], nil}
end@impl true
def handle_element_end_of_stream(:sink, _ctx_, state) do
{[terminate: :normal], state}
end
end
```## Copyright and License
Copyright 2022, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_h264_plugin)
[![Software Mansion](https://logo.swmansion.com/logo?color=white&variant=desktop&width=200&tag=membrane-github)](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_h264_plugin)
Licensed under the [Apache License, Version 2.0](LICENSE)