Membrane Element: H264 v0.1.1 Membrane.Element.RTP.H264.NAL.Header View Source

Defines a structure representing Network Abstraction Layer Unit Header

Defined in RFC6184

  +---------------+
  |0|1|2|3|4|5|6|7|
  +-+-+-+-+-+-+-+-+
  |F|NRI|  Type   |
  +---------------+

Link to this section Summary

Types

NRI stands for nal_ref_idc. This value represents importance of frame that is being parsed.

t()

Specifies the type of RBSP data structure contained in the NAL unit.

Functions

Parses type stored in NAL Header

Link to this section Types

NRI stands for nal_ref_idc. This value represents importance of frame that is being parsed.

The higher the value the more important frame is (for example key frames have nri value of 3) and a value of 00 indicates that the content of the NAL unit is not used to reconstruct reference pictures for inter picture prediction. NAL units with NRI equal 0 can be discarded without risking the integrity of the reference pictures, although these payloads might contain metadata.

Link to this type

supported_types()

View Source
supported_types() :: :stap_a | :fu_a
Link to this type

t()

View Source
t() :: %Membrane.Element.RTP.H264.NAL.Header{nal_ref_idc: nri(), type: type()}
Link to this type

type()

View Source
type() :: 1..31

Specifies the type of RBSP data structure contained in the NAL unit.

Types are defined as follows.

IDRBSP Type
0Unspecified
1-23NAL unit types
24STAP-A
25STAP-B
26MTAP-16
27MTAP-24
28FU-A
29FU-B
Reserved30-31

RBSP stands for Raw Byte Sequence Payload

RBSP types are described in detail here

Link to this type

types()

View Source
types() :: :single_nalu | supported_types() | unsupported_types() | :reserved
Link to this type

unsupported_types()

View Source
unsupported_types() :: :stap_b | :mtap_16 | :mtap_24 | :fu_b

Link to this section Functions

Link to this function

decode_type(header)

View Source
decode_type(t()) :: types()

Parses type stored in NAL Header

Link to this function

parse_unit_header(raw_nal)

View Source
parse_unit_header(binary()) ::
  {:error, :malformed_data} | {:ok, {t(), binary()}}