Socket
Socket
Sign inDemoInstall

@ffmpeg-installer/ffmpeg

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ffmpeg-installer/ffmpeg

Platform independent binary installer of FFmpeg for node projects


Version published
Weekly downloads
350K
decreased by-12.65%
Maintainers
1
Weekly downloads
 
Created

What is @ffmpeg-installer/ffmpeg?

@ffmpeg-installer/ffmpeg is an npm package that provides a simple way to install the FFmpeg binary. FFmpeg is a powerful multimedia framework that can decode, encode, transcode, mux, demux, stream, filter, and play almost anything that humans and machines have created. This package makes it easy to include FFmpeg in your Node.js projects without worrying about the complexities of installing it manually.

What are @ffmpeg-installer/ffmpeg's main functionalities?

Video Conversion

This feature allows you to convert video files from one format to another. The code sample demonstrates converting an MP4 file to an AVI file using the FFmpeg binary.

const ffmpeg = require('@ffmpeg-installer/ffmpeg');
const { exec } = require('child_process');

exec(`${ffmpeg.path} -i input.mp4 output.avi`, (error, stdout, stderr) => {
  if (error) {
    console.error(`Error: ${error.message}`);
    return;
  }
  if (stderr) {
    console.error(`Stderr: ${stderr}`);
    return;
  }
  console.log(`Stdout: ${stdout}`);
});

Audio Extraction

This feature allows you to extract audio from a video file. The code sample demonstrates extracting the audio from an MP4 file and saving it as an MP3 file.

const ffmpeg = require('@ffmpeg-installer/ffmpeg');
const { exec } = require('child_process');

exec(`${ffmpeg.path} -i input.mp4 -q:a 0 -map a output.mp3`, (error, stdout, stderr) => {
  if (error) {
    console.error(`Error: ${error.message}`);
    return;
  }
  if (stderr) {
    console.error(`Stderr: ${stderr}`);
    return;
  }
  console.log(`Stdout: ${stdout}`);
});

Video Compression

This feature allows you to compress video files to reduce their size. The code sample demonstrates compressing an MP4 file using the H.265 codec.

const ffmpeg = require('@ffmpeg-installer/ffmpeg');
const { exec } = require('child_process');

exec(`${ffmpeg.path} -i input.mp4 -vcodec libx265 -crf 28 output.mp4`, (error, stdout, stderr) => {
  if (error) {
    console.error(`Error: ${error.message}`);
    return;
  }
  if (stderr) {
    console.error(`Stderr: ${stderr}`);
    return;
  }
  console.log(`Stdout: ${stdout}`);
});

Other packages similar to @ffmpeg-installer/ffmpeg

Keywords

FAQs

Package last updated on 15 Jul 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc