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

@ffmpeg/ffmpeg

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ffmpeg/ffmpeg

FFmpeg WebAssembly version

  • 0.8.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77K
decreased by-8.07%
Maintainers
1
Weekly downloads
 
Created
Source

Please visit Kagami/ffmpeg.js if you are looking for ffmpeg.js

ffmpeg.wasm

ffmpeg.wasm

Node Version Actions Status npm (tag) Maintenance License: MIT Code Style Downloads Total Downloads Month

Use FFmpeg directly in your browser without any backend services!!

Transcode

transcode-demo

codepen

Source Code

Browsers support

Chrome
Chrome
last 2 versions

Examples:

NameDemoSource Code
WebcamcodepenLink

Supported Formats

  • mp4 (x264)
  • webm (vp8/vp9) (^0.8.0)
  • mp3 (^0.8.0)

ffmpeg.wasm provides simple to use APIs, to transcode a video you only need few lines of code:

const fs = require('fs');
const { createFFmpeg } = require('@ffmpeg/ffmpeg');

const ffmpeg = createFFmpeg({ log: true });

(async () => {
  await ffmpeg.load();
  await ffmpeg.write('test.avi', './test.avi');
  await ffmpeg.transcode('test.avi', 'test.mp4');
  fs.writeFileSync('./test.mp4', ffmpeg.read('test.mp4'));
  process.exit(0);
})();

Installation

$ npm install @ffmpeg/ffmpeg

As we are using the latest experimental features, you need to add few flags to run in Node.js

$ node --experimental-wasm-threads --experimental-wasm-bulk-memory transcode.js

Or, using a script tag in the browser (only works in Chrome):

<script src="https://unpkg.com/@ffmpeg/ffmpeg@0.8.2/dist/ffmpeg.min.js"></script>
<script>
  const { createFFmpeg } = FFmpeg;
  ...
</script>

Multi-thread

Starting from v0.8.0, multithreading is enabled and you can use this feature by passing -threads <NUM> (NUM < 8 ). For built-in functions like transcode(), you can pass it as 3rd argument.

// in transcode()
await ffmpeg.transcode('flame.avi', 'flame.mp4', '-threads 2');

// in run()
await ffmpeg.run('-i flame.avi -threads 2 flame.mp4');

Examples

Documentation

Tutorials

Learn how to build ffmpeg.wasm from stories:

Keywords

FAQs

Package last updated on 05 May 2020

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