JSPM

ffmpeg-bundle

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q23209F
  • License MIT

FFMPEG utility along with platform independent binary installer of FFmpeg for node projects

Package Exports

  • ffmpeg-bundle

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ffmpeg-bundle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ffmpeg-bundle

FFmpeg module for Node. This library provides a set of functions and utilities to abstract commands-line usage of ffmpeg. This library comes with platform independent ffmpeg binaries.

You can install this module using npm:

npm install ffmpeg-bundle

Usage

To start using this library, you must include it in your project and then you can either use the callback function or through the promise library:

var ffmpeg = require('ffmpeg-bundle');
async function process(inputFile, outputFile) {
    return new Promise(function (resolve, reject) {
        try {
            let process = ffmpeg(inputFile);
            process.then(function (video) {
                video.save(outputFile, function (error, file) {
                    if (!error) {
                        console.log('Video file: ' + file);
                        resolve(file);
                    } else {
                        console.log(error);
                        reject(error);
                    }
                });

            }, function (err) {
                console.log('Error: ' + err);
                reject(err);
            });
        } catch (e) {
            console.log(e.code);
            console.log(e.msg);
        }
    });
}

Reference

This library is combination of below two libraries

node-ffmpeg

@ffmpeg-installer/ffmpeg