Membrane.MP4.Container (Membrane MP4 plugin v0.6.0) View Source
Module for parsing and serializing MP4 files.
Bases on MP4 structure specification from Membrane.MP4.Container.Schema
.
Link to this section Summary
Functions
Maps a path in the MP4 box tree into sequence of keys under which that box resides in MP4.
Gets a box from a given path in a parsed MP4.
Parses binary data to MP4 according to Membrane.MP4.Container.Schema.schema/0
.
Parses binary data to MP4 according to a custom schema.
Same as parse/1
, raises on error.
Same as parse/2
, raises on error.
Serializes MP4 to a binary according to Membrane.MP4.Container.Schema.schema/0
.
Serializes MP4 to a binary according to a custom schema.
Same as serialize/1
, raises on error
Same as serialize/2
, raises on error
Updates a box at a given path in a parsed MP4.
Link to this section Types
Specs
box_name_t() :: atom()
Specs
field_name_t() :: atom()
Specs
fields_t() :: %{required(field_name_t()) => term() | [term()] | fields_t()}
Specs
parse_error_context_t() :: [ box: box_name_t(), field: field_name_t(), data: bitstring(), reason: :box_header | {:box_size, [header: pos_integer(), actual: pos_integer()]} ]
Specs
serialize_error_context_t() :: [box: box_name_t(), field: field_name_t()]
Specs
t() :: [ {box_name_t(), %{content: binary()} | %{fields: fields_t(), children: t()}} ]
Link to this section Functions
Specs
box_path(box_name_t() | [box_name_t()]) :: [atom()]
Maps a path in the MP4 box tree into sequence of keys under which that box resides in MP4.
Specs
get_box(t(), box_name_t() | [box_name_t()]) :: t()
Gets a box from a given path in a parsed MP4.
Specs
parse(binary()) :: {:ok, t()} | {:error, parse_error_context_t()}
Parses binary data to MP4 according to Membrane.MP4.Container.Schema.schema/0
.
Specs
parse(binary(), Membrane.MP4.Container.Schema.t()) :: {:ok, t()} | {:error, parse_error_context_t()}
Parses binary data to MP4 according to a custom schema.
Specs
Same as parse/1
, raises on error.
Specs
parse!(binary(), Membrane.MP4.Container.Schema.t()) :: t()
Same as parse/2
, raises on error.
Specs
serialize(t()) :: {:ok, binary()} | {:error, serialize_error_context_t()}
Serializes MP4 to a binary according to Membrane.MP4.Container.Schema.schema/0
.
Specs
serialize(t(), Membrane.MP4.Container.Schema.t()) :: {:ok, binary()} | {:error, serialize_error_context_t()}
Serializes MP4 to a binary according to a custom schema.
Specs
Same as serialize/1
, raises on error
Specs
serialize!(t(), Membrane.MP4.Container.Schema.t()) :: binary()
Same as serialize/2
, raises on error
Specs
update_box(t(), box_name_t() | [box_name_t()], [atom()], (term() -> term())) :: t()
Updates a box at a given path in a parsed MP4.
If parameter_path
is set, a parameter within a box is updated.