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

@browser-mc/media-container

v0.3.1

Published

Media container helpers layered above `@browser-mc/binary`.

Downloads

1,428

Readme

@browser-mc/media-container

Media container helpers layered above @browser-mc/binary.

Layers

  • isobmff: low-level box creation and iteration.
  • riff: low-level RIFF chunk creation and iteration.
  • cicp: named CICP color metadata helpers for container color signaling.
  • color-metadata: container color metadata helpers for CICP and ICC profiles.
  • avif: minimal still-image AVIF muxing and AV1 av1C helpers.
  • webp: animated WebP muxing from still WebP frames.
  • isobmff-gps: MOV/MP4 GPS metadata sanitization helpers.

Usage

import { muxStillAvif, muxAnimatedWebp } from '@browser-mc/media-container';

Color Metadata

Use readImageColorMetadata when source color signaling should be preserved without caring whether the source container used CICP or ICC:

import { readImageColorMetadata, writeImageColorMetadata } from '@browser-mc/media-container';

const metadata = readImageColorMetadata(inputBytes, 'image/avif');
// { type: 'cicp', cicp: { ... } } or { type: 'icc', profile: Uint8Array }

const jpeg = writeImageColorMetadata(encodedJpeg, 'image/jpeg', metadata);

AVIF supports both colr/nclx CICP metadata and colr/prof or colr/rICC ICC profiles. JPEG and WebP color metadata helpers preserve ICC profiles through APP2 ICC_PROFILE segments and ICCP chunks. CICP is not converted to ICC, and ICC is not converted to CICP.

Use readAvifColorSpace when a WebCodecs VideoColorSpaceInit view is enough. readAvifCicpColor remains available for callers that specifically need AVIF colr/nclx CICP metadata.

muxStillAvif writes colr from EncodedStillAv1.colorMetadata first. ICC metadata is written as colr/prof; CICP metadata is written as colr/nclx. If colorMetadata is omitted, the muxer falls back to EncodedStillAv1.color, then decoderConfig.colorSpace, then the AV1 Sequence Header:

const avif = muxStillAvif({
  chunk,
  av1Config,
  width,
  height,
  colorMetadata: {
    type: 'cicp',
    cicp: { primaries: 'bt2020', transfer: 'pq', matrix: 'bt2020-ncl', fullRange: true },
  },
  decoderConfig: { codec: 'av01.0.08M.10', codedWidth: width, codedHeight: height },
});

Unknown CICP code points round-trip as strings like unknown-123, so the muxer can write the original numeric value back even when no friendly name exists yet.

MOV/MP4 GPS Sanitization

The ISOBMFF GPS sanitizer detects iPhone-style moov/meta/keys + moov/meta/ilst metadata, common coordinate items such as com.apple.quicktime.location.ISO6709, location.ISO6709, ItemList GPSCoordinates, and ©xyz, plus likely GPS timed metadata tracks.

GPS-bearing payloads are replaced or zeroed while preserving the original box structure, byte length, and media data offsets. Horizontal accuracy metadata is left unchanged. free boxes are also scanned for stale embedded metadata copies and zeroed when GPS metadata is found there.

Commands

pnpm --filter @browser-mc/media-container build
pnpm --filter @browser-mc/media-container typecheck
pnpm --filter @browser-mc/media-container test