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

ffmpeg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ffmpeg

Utility for managing video streams using ffmpeg

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
69K
decreased by-32.94%
Maintainers
1
Weekly downloads
 
Created

What is ffmpeg?

The ffmpeg npm package is a powerful tool for handling multimedia data. It allows you to convert, stream, and manipulate audio and video files with ease. This package is a Node.js wrapper for the FFmpeg command-line tool, providing a programmatic way to access its functionalities.

What are 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.

const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
  .output('output.avi')
  .on('end', function() {
    console.log('Conversion finished');
  })
  .run();

Audio Extraction

This feature allows you to extract audio from a video file. The code sample shows how to extract the audio from an MP4 file and save it as an MP3 file.

const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
  .output('output.mp3')
  .on('end', function() {
    console.log('Audio extraction finished');
  })
  .run();

Video Streaming

This feature allows you to stream video data. The code sample demonstrates setting up a streaming pipeline using Node.js streams.

const ffmpeg = require('fluent-ffmpeg');
const stream = require('stream');
const inputStream = new stream.PassThrough();
const outputStream = new stream.PassThrough();
ffmpeg(inputStream)
  .output(outputStream)
  .on('end', function() {
    console.log('Streaming finished');
  })
  .run();
// Write data to inputStream and read from outputStream

Video Editing

This feature allows you to edit video files, such as trimming or cutting. The code sample shows how to trim a video to start at 10 seconds and last for 10 seconds.

const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
  .setStartTime('00:00:10')
  .setDuration('10')
  .output('output.mp4')
  .on('end', function() {
    console.log('Editing finished');
  })
  .run();

Other packages similar to ffmpeg

FAQs

Package last updated on 16 Jan 2013

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