Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@w3vish/ffmpeg-installer

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

@w3vish/ffmpeg-installer

Cross-platform FFmpeg and FFprobe binary installer

unpublished
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
69
15%
Maintainers
0
Weekly downloads
 
Created
Source

FFmpeg Installer

npm version License: MIT

A cross-platform FFmpeg binary installer for Node.js applications. This package automatically downloads and configures FFmpeg binaries for your platform, making it easy to use FFmpeg in your Node.js projects without manual installation.

Features

  • 🚀 Automatic FFmpeg/FFprobe binary installation
  • 🔄 Cross-platform support (Windows, macOS, Linux, and more)
  • 📦 Simple API for accessing binary paths
  • ⚙️ Customizable installation options
  • ✨ Optimized download with progress tracking
  • 🔍 Flexible - install only what you need (FFmpeg only, FFprobe only, or both)

Installation

# Install both FFmpeg and FFprobe (default)
npm install ffmpeg-installer

# Install only FFmpeg
npm install ffmpeg-installer --ffmpeg-only

# Install only FFprobe
npm install ffmpeg-installer --ffprobe-only

Usage

Basic Usage

// ES modules
import ffmpeg from 'ffmpeg-installer';

// CommonJS
const ffmpeg = require('ffmpeg-installer');

console.log('FFmpeg path:', ffmpeg.ffmpegPath);
console.log('FFprobe path:', ffmpeg.ffprobePath);
console.log('FFmpeg version:', ffmpeg.version);

With child_process

import { spawn } from 'child_process';
import { ffmpegPath } from 'ffmpeg-installer';

const process = spawn(ffmpegPath, [
  '-i', 'input.mp4',
  '-c:v', 'libx264',
  '-preset', 'fast',
  'output.mp4'
]);

process.stdout.on('data', (data) => {
  console.log(`stdout: ${data}`);
});

process.stderr.on('data', (data) => {
  console.log(`stderr: ${data}`);
});

process.on('close', (code) => {
  console.log(`Child process exited with code ${code}`);
});

With fluent-ffmpeg

import ffmpeg from 'fluent-ffmpeg';
import { ffmpegPath, ffprobePath } from 'ffmpeg-installer';

// Set paths
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg.setFfprobePath(ffprobePath);

// Use fluent-ffmpeg
ffmpeg('input.mp4')
  .output('output.mp4')
  .on('end', () => {
    console.log('Conversion finished');
  })
  .on('error', (err) => {
    console.error('Error:', err);
  })
  .run();

Advanced Usage

Custom Platform Installation

You can install binaries for a specific platform by providing the --platform flag:

npm install ffmpeg-installer --platform=win32-x64

Supported platforms:

  • win32-x64 - Windows 64-bit
  • win32-ia32 - Windows 32-bit
  • darwin-x64 - macOS 64-bit
  • darwin-arm64 - macOS Apple Silicon
  • linux-x64 - Linux 64-bit
  • linux-arm64 - Linux ARM 64-bit
  • linux-armv7l - Linux ARM v7

Install Only What You Need

You can choose to install only FFmpeg or only FFprobe:

# FFmpeg only
npm install ffmpeg-installer --ffmpeg-only

# FFprobe only
npm install ffmpeg-installer --ffprobe-only

# Combine with platform specific installation
npm install ffmpeg-installer --platform=darwin-arm64 --ffmpeg-only

API

The package exports the following properties:

PropertyTypeDescription
pathstringPath to the FFmpeg binary (alias for ffmpegPath)
ffmpegPathstringPath to the FFmpeg binary
ffprobePathstringPath to the FFprobe binary
versionstringVersion of the FFmpeg binaries
urlstringURL from where the binaries were downloaded
platformstringCurrent platform identifier
archstringCurrent architecture identifier

How It Works

This package follows these steps during installation:

  • Platform Detection: Automatically identifies your system's platform and architecture
  • Download: Fetches the appropriate FFmpeg binaries from reliable sources
  • Extraction: Unpacks the downloaded archive
  • Configuration: Sets up the binaries and creates a configuration file
  • Cleanup: Removes temporary files

The downloaded binaries are stored in a platform-specific directory within the package, making them accessible across your application.

Troubleshooting

Permission Issues

If you encounter permission errors when running the binaries:

# For Linux/macOS
chmod +x /path/to/ffmpeg
chmod +x /path/to/ffprobe

Installation Failures

If the installation fails, you can try:

npm install ffmpeg-installer --unsafe-perm

Custom Binary Location

If you have FFmpeg binaries installed elsewhere, you can manually set the path in your app:

import { spawn } from 'child_process';

// Override the path
const ffmpegPath = '/custom/path/to/ffmpeg';
const process = spawn(ffmpegPath, [...your args]);

License

MIT © Vishal Suryavanshi

Keywords

ffmpeg

FAQs

Package last updated on 20 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts