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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-nitro-media-kit

v0.2.0

Published

A native-powered React Native media toolkit for fast image and video processing, including conversion, merging, and watermarking.

Readme

react-native-nitro-media-kit

High-performance image-and-video processing for React Native powered by Nitro Modules.

⚠️ Status: Experimental — not production-ready yet

The API surface may change without notice, and certain edge-cases (see “Known issues” below) are still being debugged.

✨ Features

| Feature | Android | iOS | Notes | | --- | --- | --- | --- | | convertImageToVideo | ✔︎ | ✔︎ | Turns any local file or remote URL into an H.264 MP4 (30 fps). | | mergeVideos | ✔︎ | ✔︎ | Concatenates an arbitrary list of MP4s, normalising size/FPS when needed. | | watermarkVideo | ✔︎ | ✔︎ | Places a text watermark in 4 corners or centre – remote URLs supported. | | Hardware-backed codecs | ✔︎ | ✔︎ | Uses MediaCodec / AVFoundation surfaces for zero-copy rendering. | | Remote-URL fallback | ✔︎ | ✔︎ | Automatically downloads HTTP/HTTPS sources to a temp cache. | | Pause-free JS thread | ✔︎ | ✔︎ | All heavy lifting happens in Kotlin/Swift on background queues. |

📦 Installation

# 1) Library + peer dependency
npm i react-native-nitro-media-kit react-native-nitro-modules

# 2) iOS pods
cd ios && pod install

react-native-nitro-modules is required (this library is a Nitro Module).

Android requirements

  • Android builds use CMake/NDK (via Nitro). Make sure your RN Android toolchain is set up with the NDK installed.

🏁 Quick-start

import {
  convertImageToVideo,
  mergeVideos,
  watermarkVideo,
} from 'react-native-nitro-media-kit';

// 1️⃣ Turn a PNG into a 5-second clip
const video1 = await convertImageToVideo('https://example.com/banner.png', 5);

// 2️⃣ Add a watermark bottom-right
const watermarked = await watermarkVideo(
  video1,
  '© ACME Corp',
  'bottom-right' // top-left | top-right | bottom-left | bottom-right | center
);

// 3️⃣ Merge with an existing clip
const final = await mergeVideos([watermarked, '/storage/emulated/0/DCIM/clip.mp4']);

console.log('Done! ->', final);

🗂️ API Reference

convertImageToVideo(image: string, duration: number): Promise<string>

| Param | Type | Description | | --- | --- | --- | | image | string | Local absolute path or remote URL (http/https). | | duration | number | Length of the generated video in seconds. |

Returns: Promise<string> — Absolute path to the newly created MP4.

Under the hood the image is resized to the nearest supported H.264 resolution (1080p → 720p → 480p) while preserving aspect ratio.

mergeVideos(videos: string[]): Promise<string>

Concatenates multiple MP4s into a single file. Videos with mismatched width/height/fps are re-encoded transparently.

| Param | Type | Description | | --- | --- | --- | | videos | string[] | Array of local paths or URLs. |

Returns: Promise<string> — Path to the merged file.

watermarkVideo(video: string, watermark: string, position: string): Promise<string>

Adds a text watermark to any corner (or centre).

| Param | Type | Description | | --- | --- | --- | | video | string | Source MP4 path or URL. | | watermark | string | The text to render. | | position | string | One of top-left, top-right, bottom-left, bottom-right, center. |

Returns: Promise<string> — Path to the water-marked file.

⚠️ Troubleshooting

| Symptom | Fix | | --- | --- | | IllegalArgumentException: No video track found… | Ensure the input is an MP4 (H.264). Other containers aren’t supported yet. | | Black video on Android | Your device’s hardware codec may dislike the resolution. Use even-number dimensions (e.g. 1280×720). | | iOS export stuck at 0% | Check free disk space – AVFoundation can fail when temp space is low. |

🐞 Known issues

| Issue | Details | | --- | --- | | Occasional flicker in the output video | On certain GPU/driver and device combinations you may see a brief black frame or brightness flash in the output video. A fix is in progress. |

🗺️ Roadmap

  • Arbitrary X/Y watermark coordinates.
  • Font size / style props for watermarkVideo.
  • Contributions & PRs welcome!

🤝 Contributing

We follow the Nitro Modules contributing guide. Run examples locally with yarn example ios or yarn example android.

📄 License

MIT © 2025 — Sameer Ather

Made with ❤️ by Sameer Ather & create-react-native-library.