CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-ffprobe-installer--ffprobe

Platform independent binary installer of FFprobe for node projects

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

FFprobe Installer

FFprobe Installer is a platform-independent binary installer for FFprobe (part of the FFmpeg suite) that automatically downloads and provides access to the appropriate static binary for the current operating system and architecture. It provides a simple API that exposes the path to the FFprobe executable, version information, and homepage URL.

Package Information

  • Package Name: @ffprobe-installer/ffprobe
  • Package Type: npm
  • Language: JavaScript
  • Installation: npm install @ffprobe-installer/ffprobe

Core Imports

const ffprobe = require('@ffprobe-installer/ffprobe');

For destructuring:

const { path, version, url } = require('@ffprobe-installer/ffprobe');

ESM imports (Node.js with "type": "module" or TypeScript):

import ffprobe from '@ffprobe-installer/ffprobe';
// or
import { path, version, url } from '@ffprobe-installer/ffprobe';

Basic Usage

const ffprobe = require('@ffprobe-installer/ffprobe');

// Access the FFprobe binary path
console.log('FFprobe path:', ffprobe.path);
console.log('FFprobe version:', ffprobe.version);
console.log('FFprobe homepage:', ffprobe.url);

// Use with child_process.spawn
const { spawn } = require('child_process');
const ffprobeProcess = spawn(ffprobe.path, ['-version']);

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

// Use with fluent-ffmpeg
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfprobePath(ffprobe.path);

Platform Support

The package automatically installs the correct binary for your platform:

  • Linux: arm (armhf), arm64, ia32, x64
  • macOS: x64, arm64
  • Windows: ia32 (32-bit), x64 (64-bit)

Platform detection is automatic based on os.platform() and os.arch(), with support for npm configuration overrides via npm_config_platform and npm_config_arch environment variables. Binary integrity is verified automatically on load.

Known Issues

  • AWS/Elastic Beanstalk: Add unsafe-perm=true to .npmrc if you encounter permissions issues
  • Electron with Asar: Replace app.asar with app.asar.unpacked in the path when using Asar packaging

Capabilities

FFprobe Binary Access

Provides the complete path to the platform-specific FFprobe executable.

/**
 * Main export object containing FFprobe binary information
 * @type {{path: string, version: string, url: string}}
 */
const ffprobe = {
  /** Absolute path to the platform-specific FFprobe executable */
  path: string,
  /** Version information of the FFprobe binary */
  version: string,
  /** Homepage URL of the FFprobe project */
  url: string
};

Path Property

The absolute path to the FFprobe executable for the current platform.

/**
 * Absolute path to the platform-specific FFprobe executable.
 * Points to 'ffprobe.exe' on Windows and 'ffprobe' on other platforms.
 * @type {string}
 */
ffprobe.path

Usage Example:

const ffprobe = require('@ffprobe-installer/ffprobe');
const { execFile } = require('child_process');

// Execute FFprobe with the binary path
execFile(ffprobe.path, ['-i', 'input.mp4'], (error, stdout, stderr) => {
  if (error) {
    console.error('Error:', error);
    return;
  }
  console.log('FFprobe output:', stdout);
});

Version Property

The version information of the installed FFprobe binary.

/**
 * Version information of the FFprobe binary.
 * Extracted from the platform-specific package's package.json.
 * @type {string}
 */
ffprobe.version

Usage Example:

const ffprobe = require('@ffprobe-installer/ffprobe');

console.log(`Using FFprobe version: ${ffprobe.version}`);
// Output: Using FFprobe version: 5.1.2

URL Property

The homepage URL of the FFprobe project.

/**
 * Homepage URL of the FFprobe project.
 * Extracted from the platform-specific package's package.json.
 * @type {string}
 */
ffprobe.url

Usage Example:

const ffprobe = require('@ffprobe-installer/ffprobe');

console.log(`FFprobe homepage: ${ffprobe.url}`);
// Output: FFprobe homepage: https://ffmpeg.org/

Error Handling

The package throws errors in the following cases:

  • Unsupported Platform: If the current platform/architecture combination is not supported
  • Binary Not Found: If the FFprobe executable cannot be found at the expected path
  • File Verification Failed: If the binary file is corrupted or invalid
try {
  const ffprobe = require('@ffprobe-installer/ffprobe');
  console.log('FFprobe is available at:', ffprobe.path);
} catch (error) {
  if (error.message.includes('Unsupported platform')) {
    console.error('Your platform is not supported');
  } else if (error.message.includes('Could not find ffprobe executable')) {
    console.error('FFprobe binary is missing or corrupted');
  } else {
    console.error('Unknown error:', error.message);
  }
}
Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@ffprobe-installer/ffprobe@2.1.x
Publish Source
CLI
Badge
tessl/npm-ffprobe-installer--ffprobe badge