npm.io
0.1.2 • Published 1 week ago

@moq/loc

Licence
(MIT OR Apache-2.0)
Version
0.1.2
Deps
1
Size
28 kB
Vulns
0
Weekly
0
Stars
1.4K

@moq/loc

Encode and decode frames for the Low Overhead Container (LOC), a lightweight container format defined by the MoQ working group.

Each LOC frame is a small property block (timestamp, optional per-frame timescale) followed by a raw codec bitstream payload. This package provides Format (decoder) and Producer (encoder) classes that plug into @moq/hang's container dispatch.

Installation

npm add @moq/loc

Usage

import * as Loc from "@moq/loc";

// Decode incoming LOC frames
const format = new Loc.Format();
const frames = format.decode(rawFrameBytes);

// Encode outgoing LOC frames
const producer = new Loc.Producer(track);
producer.encode(payload, timestampMicros, keyframe);

License

MIT OR Apache-2.0