ffmpeg-helper
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

ffmpeg-helper

ffmpeg-helper is a simple Node.js module for executing platform-dependent binaries. It supports multiple architectures (x64 and arm64) across macOS, Linux, and Windows.

The module provides the name and path of the binary and a function to run commands with the binary.

The binaries comes from https://github.com/eugeneware/ffmpeg-static/releases

The source code is available at https://github.com/jadujoel/ffmpeg-helper

Installation

npm install ffmpeg-helper

Usage

Run the ffmpeg executable:

npx ffmpeg-helper -i test.wav test.mp4

Or, import the module in your script.

import { name, path, run } from 'ffmpeg-helper';

Then, you can use the exported properties and functions:

console.log(`Running on platform: ${name}`);
console.log(`Binary path: ${path}`);

run('-i test.wav test.mp4')
  .then((output) => {
    console.log(`Command output: ${output}`);
  })
  .catch((error) => {
    console.error(`Error executing command: ${error}`);
  });

run is a function that executes a command with the platform-dependent binary and returns a Promise. The Promise resolves with the output of the command if it was successful, or rejects with an error if the command failed.

Supported Platforms and Architectures

ffmpeg-helper currently supports the following platforms and architectures:

  • macOS
    • x64
    • arm64
  • Linux
    • x64
    • arm64
  • Windows
    • x64
    • ia32

If a platform or architecture is not supported, an error will be thrown.

Types

if you get "any" as types when importing, then add "@types/node" to your dependencies.

Readme

Keywords

none

Package Sidebar

Install

npm i ffmpeg-helper

Weekly Downloads

139

Version

0.1.2

License

GPL-3.0-or-later

Unpacked Size

470 MB

Total Files

35

Last publish

Collaborators

  • jadujoel