moonmedia Reel 01 · Containers & playlists

Reel 01 · The archive

moonmedia

HLS playlists, fragmented MP4, MPEG-TS, RTMP and DASH manifests, read into a model and written back from it. Every format arrives as bytes a request carried and leaves as bytes to serve.

Five formats · one library · bytes in, bytes out, no socket and no file

5containers and
playlists
188bytes in a transport
packet
90 kHzon every
timestamp
33 bitsof clock in
a PCR
CRC-32on every
table

Reel 02 · What it does

Read it, walk it, write it back

Each package does one job. A program that only needs playlists does not carry a container parser.

01

Byte for byte

A file is read into a tree of boxes and written back from it. A box this package has no name for keeps its payload and its header, so the bytes that come out are the bytes that went in.

02

Cuts on key frames

The packager splits a movie where a decoder can start: an initialisation section first, then one fragment per key frame, with the audio that belongs to it.

03

Every tag, either way

Master and media playlists, every tag of RFC 8216 and the low-latency additions. Attributes this release does not model are kept as they were written.

04

Tables that check themselves

PAT and PMT with their checksums, the programme clock, the continuity counter, and the elementary streams put back together with their timestamps.

05

Chunks assembled

Chunk streams with extended timestamps, AMF0 values, and the commands a publisher sends before its first frame, driven by a session you hand bytes to.

06

Manifests without a second library

DASH periods, adaptation sets and timelines, with the three ways a manifest addresses a segment: a template, a list of URLs, a file with a byte range. Read from XML and written back as XML.

Nothing here opens a socket or a file. Bytes in, bytes out; what to serve is the caller's business.

The shape of the library

Reel 03 · The reading room

Read a playlist in the page

The parser below is this package, compiled to JavaScript. Edit the text on the left; the right is what the library read.

moviola · m3u8
reading…
    
              
            
    Parsed by m3u8 in this page. Written back in the order the specification lists. How it is called →

    Reel 04 · The cutting room

    One second, three ways

    Where a movie is cut, what a fragment is made of, and how 188 bytes carry a frame. Every number on that page comes from a real segment.

    Open the anatomy
    segment 0 · 0.60 s segment 1 · 0.60 s key frame at 0 s key frame at 0.6 s

    Install

    One package brings the five formats and the packager. Packages are imported on their own, so nothing unused is carried.

    shell
    moon add moonbitstack/moonmedia