View Source ExMP4.Box.Traf (MP4 Reader and Writer v0.6.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 count of samples 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

Link to this function

duration(traf, trex \\ nil)

View Source
@spec duration(t(), ExMP4.Box.Trex.t() | nil) :: integer()

Get the total duration of the track fragment.

Link to this function

finalize(traf, base_is_moof? \\ false)

View Source
@spec finalize(t(), boolean()) :: 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 count of samples of the track fragment.

Link to this function

store_sample(traf, sample)

View Source
@spec store_sample(t(), ExMP4.Sample.t()) :: t()
Link to this function

total_size(traf, trex \\ nil)

View Source
@spec total_size(t(), ExMP4.Box.Trex.t() | nil) :: integer()

Get the total size of the track fragment.

Link to this function

update_base_offset(traf, base_offset, trun_data_offset \\ 0)

View Source
@spec update_base_offset(t(), integer(), integer()) :: t()