Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Release v0.3.0 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
gBillal authored Sep 16, 2023
1 parent 5eba5ca commit f971f60
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 8 deletions.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Membrane H265 Plugin

[![Hex.pm](https://img.shields.io/hexpm/v/membrane_h265_plugin.svg)](https://hex.pm/packages/membrane_h265_plugin)
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_h265_plugin)


Membrane H265 parser. It is the Membrane element responsible for parsing the incoming h265 stream. The parsing is done as a sequence of the following steps:

* Splitting the h265 stream into stream NAL units, based on the "Annex B" of the "ITU-T Rec. H.265 (08/2021)"
Expand All @@ -16,7 +20,35 @@ The package can be installed by adding `membrane_h265_plugin` to your list of de
```elixir
def deps do
[
{:membrane_h265_plugin, "~> 0.1.0"}
{:membrane_h265_plugin, "~> 0.3.0"}
]
end
```

## Usage

The following pipeline takes H265 file, parses it, and then decodes it to the raw video.

```elixir
defmodule Decoding.Pipeline do
use Membrane.Pipeline

alias Membrane.{File, H265}

@impl true
def handle_init(_ctx, _opts) do
structure =
child(:source, %File.Source{location: "test/fixtures/input-10-1920x1080.h265"})
|> child(:parser, H265.Parser)
|> child(:decoder, H265.FFmpeg.Decoder)
|> child(:sink, %File.Sink{location: "output.raw"})

{[spec: structure], nil}
end

@impl true
def handle_element_end_of_stream(:sink, _ctx_, state) do
{[terminate: :normal], state}
end
end
```
2 changes: 1 addition & 1 deletion lib/membrane_h265_plugin/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ defmodule Membrane.H265.Parser do
By default, the parser adds negative DTS offset to the timestamps,
so that in case of frame reorder (which always happens when B frames
are present) the DTS was always bigger than PTS. If that is not desired,
are present) the DTS is always bigger than PTS. If that is not desired,
you can set `add_dts_offset: false`.
The calculated DTS/PTS may be wrong since we base it on access units' POC (Picture Order Count).
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.H265.Plugin.Mixfile do
use Mix.Project

@version "0.2.0"
@version "0.3.0"
@github_url "https://github.com/gBillal/membrane_h265_plugin"

def project do
Expand Down
2 changes: 1 addition & 1 deletion test/integration/modes_test.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Membrane.H265.ModesTest do
@moduledoc false
use ExUnit.Case
use ExUnit.Case, async: true

import Membrane.ChildrenSpec
import Membrane.H265.Support.Common
Expand Down
2 changes: 1 addition & 1 deletion test/parser/au_splitter_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule AUSplitterTest do
@moduledoc false

use ExUnit.Case
use ExUnit.Case, async: true

@test_files_names ["10-1920x1080", "10-480x320-mainstillpicture"]

Expand Down
2 changes: 1 addition & 1 deletion test/parser/process_all_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.H265.ProcessAllTest do
@moduledoc false

use ExUnit.Case
use ExUnit.Case, async: true

import Membrane.ChildrenSpec
import Membrane.Testing.Assertions
Expand Down
4 changes: 3 additions & 1 deletion test/parser/skip_until_test.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
defmodule Membrane.H265.SkipUntilTest do
@moduledoc false

use ExUnit.Case
use ExUnit.Case, async: true

import Membrane.ChildrenSpec
import Membrane.Testing.Assertions

alias Membrane.H265
alias Membrane.Testing.Pipeline

Expand Down
2 changes: 1 addition & 1 deletion test/parser/stream_structure_conversion_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.H265.StreamStructureConversionTest do
@moduledoc false

use ExUnit.Case
use ExUnit.Case, async: true

import Membrane.ChildrenSpec
import Membrane.Testing.Assertions
Expand Down

0 comments on commit f971f60

Please sign in to comment.