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

ffmpeg-eloquent

v0.0.5

Published

A modern and fluent FFmpeg wrapper

Readme

🚀 ffmpeg-eloquent

GitLab NPM Version License: GPLv3.0 TypeScript

A lightweight, fluent, and powerful FFmpeg wrapper for Bun and Node.js, built from the ground up with TypeScript. Designed for simplicity, reliability, and modern developer experience.

⚠️ Beta Notice: This package is currently in Beta. Some APIs might evolve, and we are actively working on stability and features.


✨ Features

  • Fluent API: Chainable methods that read like a story.
  • Modern Runtimes: Optimized for Bun and Node.js.
  • TypeScript First: Full type safety for options and methods.
  • Stream Support: Handle input and output using native Node.js/Bun streams.
  • Lightweight: Zero heavy dependencies.

🛠 Prerequisites

This package leverages modern FFmpeg features.

  • FFmpeg: v8.1 or higher (Recommended for full feature support)
  • Node.js (v18+) or Bun (v1.0+)

Make sure FFmpeg is installed and added to your system's PATH.


📦 Installation

# Using Bun (Recommended)
bun add ffmpeg-eloquent

# Using NPM
npm install ffmpeg-eloquent

# Using PNPM
pnpm add ffmpeg-eloquent

🚀 Quick Start

Basic Conversion

Easily convert a video to another format with a few lines.

import Ffmpeg from 'ffmpeg-eloquent';

const ffmpeg = new Ffmpeg();

await ffmpeg
  .addInput('input.mp4')
  .toFormat('webp')
  .save('output.webp');

console.log('Conversion finished!');

Working with Streams

Pipe your data directly into FFmpeg or get a stream back.

import Ffmpeg from 'ffmpeg-eloquent';
import { createReadStream, createWriteStream } from 'node:fs';

const inputStream = createReadStream('video.mp4');
const ffmpeg = new Ffmpeg();

ffmpeg
  .addInput(inputStream)
  .toFormat('mp3')
  .audioCodec('libmp3lame')
  .duration(30); // Grab first 30 seconds

// Get a Readable stream
const outputStream = ffmpeg.stream();
outputStream.pipe(createWriteStream('preview.mp3'));

Detailed Input Options

Configure your inputs precisely.

import Ffmpeg from 'ffmpeg-eloquent';

const ffmpeg = new Ffmpeg();

ffmpeg.addInput('video.mkv', {
  seek: '00:00:05',   // Start at 5 seconds
  duration: 10,       // Process 10 seconds
  fps: 24,            // Force frame rate
  loop: 1             // Loop input once
});

await ffmpeg.save('clip.mp4');

📖 API Reference

Ffmpeg Class

| Method | Description | | :--- | :--- | | .addInput(media, options?) | Adds an input source (path or Stream) with optional InputOptions. | | .toFormat(format) | Sets the output format (e.g., mp4, mp3, webp). | | .noAudio() | Disables audio in the output. | | .duration(seconds) | Sets the output duration. | | .audioCodec(codec) | Sets the audio codec (e.g., libmp3lame, aac). | | .customArgs(...args) | Pass any raw FFmpeg arguments directly. | | .save(path) | Starts the process and saves the output to a file. Returns Promise<void>. | | .stream() | Starts the process and returns a Readable stream of the output. |

InputOptions

  • seek: -ss (string, e.g., '00:00:01')
  • duration: -t (number in seconds)
  • loop: -stream_loop (number)
  • fps: -r (number)
  • format: -f (string)
  • channel: -ac (number, 1 or 2)
  • rate: -ar (number, e.g., 44100)

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitLab.

  1. Fork the repository.
  2. Create your feature branch.
  3. Commit your changes.
  4. Push to the branch.
  5. Create a new Pull/Merge Request.

📄 License

This project is licensed under the GPL-3.0. See the LICENSE file for details.

Built with ❤️ by xaliazhar