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

@stefanmartin/expo-video-compress

v0.3.0

Published

trims the beginning of a video so the first video frame is always at t=0 of the video. Also converts video to h265 for android; ios already records with h265 by default.

Readme

expo-video-compress

An Expo native module that processes videos recorded on device:

  1. Trims leading dead frames — Many device cameras produce videos where the first frame's presentation timestamp (PTS) is not at 0. This module detects that offset and trims the beginning so the first valid frame starts at t=0.
  2. Converts H.264 to H.265/HEVC (Android only) — If the source video is not already HEVC-encoded, it re-encodes to H.265 for smaller file sizes. iOS devices record in HEVC natively so no conversion is needed.
  3. HDR tone-mapping (Android only) — HDR videos are tone-mapped to SDR using OpenGL.

API

trimVideo(videoPath: string): Promise<VideoCompressResult>

Processes a video and returns metadata about what was done.

Parameters:

  • videoPath — A local file:// URI pointing to the source video.

Returns a VideoCompressResult:

type VideoCompressResult = {
  uri: string;                 // file:// URI of the processed (or original) video
  trimmedStartSeconds: number; // seconds trimmed from the beginning (0 if no trim was needed)
  convertedToHevc: boolean;    // true if the video was re-encoded from H.264 to H.265
};

If no processing is needed (first frame is already at t=0 and codec is already HEVC), the original videoPath is returned as uri with trimmedStartSeconds: 0 and convertedToHevc: false.

Errors include trimmedStartSeconds and convertedToHevc in the error message when those values are known at the point of failure.

Usage

import ExpoVideoCompress from 'expo-video-compress';

const result = await ExpoVideoCompress.trimVideo(videoUri);
console.log(result.uri);                 // "file:///path/to/processed.mp4"
console.log(result.trimmedStartSeconds); // e.g. 0.033
console.log(result.convertedToHevc);     // true on Android if source was H.264

Installation

Managed Expo projects

npx expo install expo-video-compress

Bare React Native projects

Ensure you have installed and configured the expo package first.

npm install expo-video-compress

Then run npx pod-install for iOS.

Platform support

| Feature | iOS | Android | Web | |---|---|---|---| | Trim leading frames | Yes | Yes | No | | H.264 to H.265 | No (not needed) | Yes | No | | HDR tone-mapping | No | Yes | No |

Minimum versions: iOS 15.1, Android SDK 33.