View Source ExMP4.Box.Traf (MP4 Reader and Writer v0.5.0)

A module repsenting an traf box.

Summary

Functions

Get the total duration of the track fragment.

Get the next sample from the fragment.

Get the total duration of the track fragment.

Get the total size of the track fragment.

Types

@type t() :: %ExMP4.Box.Traf{
  tfdt: ExMP4.Box.Tfdt.t() | nil,
  tfhd: ExMP4.Box.Tfhd.t(),
  trun: [ExMP4.Box.Trun.t()]
}

Functions

@spec duration(t(), ExMP4.Box.Trex.t()) :: integer()

Get the total duration of the track fragment.

@spec finalize(t()) :: t()
Link to this function

next_sample(traf, trex, duration)

View Source
@spec next_sample(t(), ExMP4.Box.Trex.t(), integer()) ::
  {t(), ExMP4.SampleMetadata.t()}

Get the next sample from the fragment.

The trex argument is the trex box that contains global defaults.

The duration refers to the total duration of the extracted samples. This field should be updated by the caller and provided in each call.

It returns a tuple with the first element being the traf box after removing the sample entry and the second element as the sample metadata.

@spec sample_count(t()) :: integer()

Get the total duration of the track fragment.

Link to this function

store_sample(traf, sample)

View Source
@spec store_sample(t(), ExMP4.Sample.t()) :: t()
@spec total_size(t(), ExMP4.Box.Trex.t()) :: integer()

Get the total size of the track fragment.