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.
Reel 01 · The archive
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
Reel 02 · What it does
Each package does one job. A program that only needs playlists does not carry a container parser.
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.
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.
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.
PAT and PMT with their checksums, the programme clock, the continuity counter, and the elementary streams put back together with their timestamps.
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.
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 libraryReel 03 · The reading room
The parser below is this package, compiled to JavaScript. Edit the text on the left; the right is what the library read.
m3u8 in this page. Written back in the order the specification lists.
How it is called →
One package brings the five formats and the packager. Packages are imported on their own, so nothing unused is carried.
moon add moonbitstack/moonmedia