View Source ExMP4.Track (MP4 Reader and Writer v0.1.0)
A struct describing an MP4 track.
Summary
Types
@type id() :: non_neg_integer()
@type t() :: %ExMP4.Track{ channels: non_neg_integer() | nil, duration: non_neg_integer(), height: non_neg_integer() | nil, id: id(), media: :h264 | :h265 | :aac | :opus | :unknown, media_tag: ExMP4.Container.box_name_t(), movie_duration: integer() | nil, priv_data: binary(), sample_count: non_neg_integer(), sample_rate: non_neg_integer() | nil, sample_table: ExMP4.Track.SampleTable.t() | nil, timescale: non_neg_integer(), type: :video | :audio | :subtitle | :unknown, 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 boxname
to use for the:media
.This field is used to indicate the layout of some codec specific data, take for example
H264
,avc1
indicates that parameter sets are included in the sample description and removed from the samples themselves.:duration
- the duration of the track in:timescale
units.: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 chunk_duration(t()) :: ExMP4.duration()
@spec flush_chunk(t(), ExMP4.offset()) :: {binary(), t()}
Create a new track