ExMP4.Box.Sidx (MP4 Reader and Writer v0.11.0)

View Source

A module representing sidx box.

This box provides a compact index of one media stream within the media segment to which it applies

Summary

Functions

Calculates the bitrate (bps) of the segment.

Gets the total duration of the segment.

Gets the total size of the segment.

Types

t()

@type t() :: %ExMP4.Box.Sidx{
  earliest_presentation_time: integer(),
  entries: [
    %{
      reference_type: integer(),
      referenced_size: integer(),
      subsegment_duration: integer(),
      starts_with_sap: integer(),
      sap_type: integer(),
      sap_delta_time: integer()
    }
  ],
  first_offset: integer(),
  flags: integer(),
  reference_id: integer() | nil,
  timescale: integer() | nil,
  version: integer()
}

Functions

bitrate(segment)

@spec bitrate(t()) :: integer()

Calculates the bitrate (bps) of the segment.

duration(sidx, unit \\ nil)

@spec duration(t(), atom() | nil) :: integer()

Gets the total duration of the segment.

If unit is provided, it will convert the duration to that unit.

size(sidx)

@spec size(t()) :: integer()

Gets the total size of the segment.