Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ffmpeg-static

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ffmpeg-static

ffmpeg binaries for macOS, Linux and Windows

  • 5.2.0
  • next
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
134K
increased by12.88%
Maintainers
4
Weekly downloads
 
Created

What is ffmpeg-static?

The ffmpeg-static npm package provides a static binary of FFmpeg, which is a powerful multimedia framework used to decode, encode, transcode, mux, demux, stream, filter, and play almost anything that humans and machines have created. This package allows you to use FFmpeg without having to install it separately on your system.

What are ffmpeg-static'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-static binary.

const ffmpegPath = require('ffmpeg-static');
const { exec } = require('child_process');

exec(`${ffmpegPath} -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 audio from an MP4 file and saving it as an MP3 file.

const ffmpegPath = require('ffmpeg-static');
const { exec } = require('child_process');

exec(`${ffmpegPath} -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 ffmpegPath = require('ffmpeg-static');
const { exec } = require('child_process');

exec(`${ffmpegPath} -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-static

Keywords

FAQs

Package last updated on 07 Jul 2023

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