Membrane.MP4.Track (Membrane MP4 plugin v0.36.1)

View Source

A module defining a structure that represents an MPEG-4 track.

All new samples of a track must be stored in the structure first in order to build a sample table of a regular MP4 container. Samples that were stored can be flushed later in form of chunks.

Summary

Types

t()

@type t() :: %Membrane.MP4.Track{
  chunk_dts_overbound: integer() | nil,
  chunk_duration: non_neg_integer() | nil,
  duration: non_neg_integer() | nil,
  id: pos_integer(),
  movie_duration: non_neg_integer() | nil,
  sample_table: Membrane.MP4.Track.SampleTable.t(),
  stream_format: struct(),
  timescale: pos_integer()
}

Functions

completed?(track)

@spec completed?(t()) :: boolean()

finalize(track, movie_timescale)

@spec finalize(t(), pos_integer()) :: t()

flush_chunk(track, chunk_offset)

@spec flush_chunk(t(), non_neg_integer()) :: {binary(), t()}

get_encoding_info(arg1)

@spec get_encoding_info(t()) ::
  {:mp4a, %{aot_id: binary(), channels: integer(), frequency: integer()}}
  | {:avc1, %{profile: binary(), compatibility: binary(), level: binary()}}
  | {:hvc1,
     %{
       profile: non_neg_integer(),
       tier: non_neg_integer(),
       level: non_neg_integer()
     }}
  | nil

new(id, stream_format, chunk_duration \\ nil)

@spec new(pos_integer(), struct(), non_neg_integer() | nil) :: t()

store_sample(track, buffer)

@spec store_sample(t(), Membrane.Buffer.t()) :: t()