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

wrapbox

v0.1.0

Published

Video rendering and processing library

Readme

wrapbox

A focused library for video rendering and processing, specializing in recodemuxing and MP4 box handling using WebCodecs.

Features

  • Recodemuxing: High-performance video and audio encoding/decoding.
  • MP4 Box Handling: Deep integration with mp4box.js for structured MP4 creation.
  • WebCodecs Integration: Optimized for modern browser-based video processing.
  • Metadata Support: Easy addition of metadata tags to MOOV boxes.

Installation

npm install wrapbox

Quick Start: recodemux

The recodemux function is the core utility for handling audio and video streams simultaneously, synchronizing them into a valid MP4 file.

import { recodemux } from 'wrapbox';

const muxer = recodemux({
  video: {
    width: 1920,
    height: 1080,
    expectFPS: 30,
    codec: 'avc1.42E01E',
    bitrate: 5_000_000,
  },
  audio: {
    codec: 'aac',
    sampleRate: 44100,
    channelCount: 2,
  },
  duration: 10000, // Duration in ms
});

// To encode video (VideoFrame from WebCodecs)
muxer.encodeVideo(videoFrame, { keyFrame: true });

// To encode audio (AudioData from WebCodecs)
muxer.encodeAudio(audioData);

// Finalize the file
await muxer.flush();
muxer.close();

// Access the underlying mp4box file
const mp4 = muxer.mp4file;

Advanced MP4 Box Access

wrapbox provides direct access to mp4box.js primitives:

import { createFile } from 'wrapbox';

const mp4file = createFile();
mp4file.onReady = (info) => {
  console.log('MP4 is ready', info);
};

API Reference

recodemux(opts: RecodeMuxOpts)

  • video: Configuration for the video track (width, height, FPS, codec, bitrate).
  • audio: Configuration for the audio track (codec, sampleRate, channelCount).
  • duration: (Optional) Total duration of the media.
  • metaDataTags: (Optional) Key-value pairs to add as metadata.

Returns

  • encodeVideo(frame, options): Encodes a VideoFrame.
  • encodeAudio(data): Encodes AudioData.
  • flush(): Returns a promise that resolves when all data is processed.
  • close(): Cleans up resources.
  • mp4file: The underlying MP4File instance.

License

WrapBox is licensed under a two-tier system:

  • Free License: For individuals, small teams (up to 3 employees), and non-profits.
  • Company License: For organizations with more than 3 employees.

For detailed terms, see LICENSE.

Telemetry

To improve the library and monitor usage for licensing compliance, WrapBox includes anonymous telemetry. It sends a simple ping when the library is initialized and when video creation starts. No personal data or video content is ever transmitted.