MPEG.TS.Muxer (MPEG.TS v2.2.0)

View Source

Module responsible for muxing acces units into mpeg-ts packets.

Summary

Functions

Mux the PAT table into a packet.

Mux a PCR packet.

Mux the PMT table into a packet.

Create a new muxer.

Types

t()

@type t() :: %MPEG.TS.Muxer{
  continuity_counters: %{required(MPEG.TS.Packet.pid_t()) => 0..15},
  pat: MPEG.TS.PAT.t(),
  pid_to_stream_id: %{required(MPEG.TS.Packet.pid_t()) => non_neg_integer()},
  pmt: MPEG.TS.PMT.t()
}

timestamp()

@type timestamp() :: non_neg_integer()

Functions

add_elementary_stream(muxer, stream_type_id, pcr? \\ false)

@spec add_elementary_stream(t(), MPEG.TS.PMT.stream_type_id_t(), boolean()) ::
  {MPEG.TS.Packet.pid_t(), t()}

Add a new elementary stream.

mux_pat(muxer)

@spec mux_pat(t()) :: {MPEG.TS.Packet.t(), t()}

Mux the PAT table into a packet.

mux_pcr(muxer, pcr)

@spec mux_pcr(t(), timestamp()) :: {MPEG.TS.Packet.t(), t()}

Mux a PCR packet.

mux_pmt(muxer)

@spec mux_pmt(t()) :: {MPEG.TS.Packet.t(), t()}

Mux the PMT table into a packet.

mux_sample(muxer, pid, payload, pts, opts \\ [])

@spec mux_sample(
  t(),
  MPEG.TS.Packet.pid_t(),
  iodata(),
  timestamp(),
  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. Default: nil

new()

@spec new() :: t()

Create a new muxer.