MPEG.TS.Muxer (MPEG.TS v3.2.3)
View SourceModule responsible for muxing acces units into mpeg-ts packets.
Summary
Functions
Add a new elementary stream.
Mux the PAT table into a packet.
Mux a PCR packet.
Mux the PMT table into a packet.
Mux a generic PSI into a packet.
Mux a media sample.
Create a new muxer.
Types
@type t() :: %MPEG.TS.Muxer{ continuity_counters: %{required(MPEG.TS.Packet.pid_t()) => 0..15}, pat: MPEG.TS.PAT.t(), pat_version: pos_integer(), pid_to_stream_id: %{required(MPEG.TS.Packet.pid_t()) => non_neg_integer()}, pmt: MPEG.TS.PMT.t(), pmt_version: pos_integer() }
Functions
@spec add_elementary_stream(t(), atom(), Keyword.t()) :: {MPEG.TS.Packet.pid_t(), t()}
Add a new elementary stream.
@spec mux_pat(t()) :: {MPEG.TS.Packet.t(), t()}
Mux the PAT table into a packet.
@spec mux_pcr(t(), MPEG.TS.timestamp_ns()) :: {MPEG.TS.Packet.t(), t()}
Mux a PCR packet.
@spec mux_pmt(t()) :: {MPEG.TS.Packet.t(), t()}
Mux the PMT table into a packet.
@spec mux_psi(t(), MPEG.TS.Packet.pid_t(), MPEG.TS.PSI.t()) :: {MPEG.TS.Packet.t(), t()}
Mux a generic PSI into a packet.
@spec mux_sample( t(), MPEG.TS.Packet.pid_t(), iodata(), MPEG.TS.timestamp_ns(), keyword() ) :: {[MPEG.TS.Packet.t()], t()}
Mux a media sample.
The following optional options may be provided:
:sync?
- whether the sample is a sync sample (keyframe). Default:false
:send_pcr?
- whether to send a PCR with this sample. Default:false
:dts
- the decoding timestamp of the sample (in nanoseconds). Default:nil
Timestamps are in nanoseconds.
@spec new() :: t()
Create a new muxer.