npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@svta/cml-608

v1.1.1

Published

CTA-608/CEA-608 closed captioning functionality

Readme

@svta/cml-608

CTA-608/CEA-608 closed captioning functionality.

Installation

npm i @svta/cml-608

Usage

import { CaptionScreen, Row } from "@svta/cml-608";

Extracting captions from a media sample

CTA-608 captions are embedded in the video elementary stream as an ATSC A/53 cc_data() payload. Only the envelope around the payload differs by codec. The envelope is either a SEI message in a NAL unit, or an OBU. Choose the extractor that matches the sample entry type:

| Sample entry | Envelope | Extractor | | ----------------------- | --------------------------------- | ---------------------------------- | | avc1 / hvc1 / vvc1 | itu_t_t35 SEI message in a NAL | extractCta608DataFromSample | | av01 | metadata_itu_t_t35 OBU | extractCta608DataFromAv1Sample |

Both extractors return the same [field1, field2] byte arrays. Cta608Parser renders them as caption screens:

import { Cta608Parser, extractCta608DataFromAv1Sample } from "@svta/cml-608";
import type { CaptionScreen } from "@svta/cml-608";

const parser = new Cta608Parser(1, {
	newCue(startTime: number, endTime: number, screen: CaptionScreen) {
		console.log(startTime, endTime, screen.getDisplayText());
	},
}, null);

// Call once per AV1 sample. The sample starts at samplePos in view.
function onSample(view: DataView, samplePos: number, sampleSize: number, sampleTimeMs: number): void {
	const [field1] = extractCta608DataFromAv1Sample(view, samplePos, sampleSize);
	if (field1.length) {
		parser.addData(sampleTimeMs, field1);
	}
}

The two extractors are separate because the two envelopes are framed differently, and a sample does not announce its framing. A NAL unit sample puts a fixed-width big-endian length before each unit. Only lengthSizeMinusOne in the avcC or hvcC config gives that width. An AV1 sample uses the low-overhead format. Each OBU has its own obu_size after the header, and the last OBU may omit it. In both cases the sample entry gives the framing.