View Source Membrane.MP4.Track (Membrane MP4 plugin v0.34.1)

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

@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

@spec completed?(t()) :: boolean()
Link to this function

finalize(track, movie_timescale)

View Source
@spec finalize(t(), pos_integer()) :: t()
Link to this function

flush_chunk(track, chunk_offset)

View Source
@spec flush_chunk(t(), non_neg_integer()) :: {binary(), t()}
@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
Link to this function

new(id, stream_format, chunk_duration \\ nil)

View Source
@spec new(pos_integer(), struct(), non_neg_integer() | nil) :: t()
Link to this function

store_sample(track, buffer)

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