ExMP4.Track (MP4 Reader and Writer v0.14.1)
View SourceA struct describing an MP4 track.
Summary
Functions
Gets the bitrate of the track in bps (bit per second)
Gets the duration of the track.
Gets the fps (frames per second) of the video track.
Creates a new track
Gets the next sample.
Types
@type codecs() :: :av1 | :h264 | :h265 | :vp8 | :vp9 | :aac | :opus | :raw | :unknown
@type id() :: non_neg_integer()
@type media_types() :: :video | :audio | :subtitle | :unknown
@type t() :: %ExMP4.Track{ _chunk_id: term(), _iter_duration: term(), _reducer: term(), _stsc_entry: term(), channels: non_neg_integer() | nil, duration: non_neg_integer(), height: non_neg_integer() | nil, id: id(), media: codecs(), media_tag: atom(), movie_duration: term(), priv_data: binary() | struct(), sample_count: non_neg_integer(), sample_rate: non_neg_integer() | nil, sample_table: ExMP4.Box.Stbl.t() | nil, timescale: non_neg_integer(), trafs: [ExMP4.Box.Traf.t()], trex: ExMP4.Box.Trex.t() | nil, type: media_types(), width: non_neg_integer() | nil }
Struct describing an mp4 track.
The public fields are:
:id- the track id:type- the type of the media of the track:media- the codec used to encode the media.:media_tag- the boxnameto use for the:media.This field is used to indicate the layout of some codec specific data, take for example
H264,avc1indicates that parameter sets are included in the sample description and removed from the samples themselves.:priv_data- private data specific to the contained:media.:duration- the duration of the track in:timescaleunits.:timescale- the timescale used for the track.:width- the width of the video frames.:height- the height of the video frames.:sample_rate- the sample rate of audio samples.:channels- the number of audio channels.:sample_count- the total count of samples.
Functions
@spec bitrate(t()) :: non_neg_integer()
Gets the bitrate of the track in bps (bit per second)
@spec duration(t(), ExMP4.Helper.timescale()) :: integer()
Gets the duration of the track.
Gets the fps (frames per second) of the video track.
Creates a new track
@spec next_sample(t()) :: {ExMP4.SampleMetadata.t(), t()} | :done
Gets the next sample.