Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

h264-nalu-parser

gliese133755MIT1.0.0TypeScript support: included

A parser for H264 NAL unit streams.

mpeg, ts, h264, mpeg-ts, demux, video

readme

H.264 NAL Unit Parser

This module exports a single generator function producing Uint8Arrays containing single Network Abstraction Layer units. Basic usage is as follows:

import parseNALUStream from 'h264-nalu-parser';

for (const nalu of parseNALUStream(data)) {
  /* Do stuff with an individual NAL unit. */
}

The data should also be provided as a Uint8Array, aligned on NALU boundaries.

Note that this will not work with H.264 data extracted from an MP4 file; the MP4 container format separates individual NALUs with 4-byte length headers, which this parser does not expect.