FFmpeg WebAssembly version
npm install @mutagen-d/ffmpeg






Use FFmpeg directly in your browser without any backend services!!
Transcode
| Name | Demo | Source Code |
| ---- | ------- | ----------- |
| Webcam |
| Link |
---
ffmpeg.js provides simple to use APIs, to transcode a video you only need few lines of code:
``javascript
const fs = require('fs');
const { createWorker } = require('@ffmpeg/ffmpeg');
const worker = createWorker();
(async () => {
await worker.load();
await worker.write('test.avi', './test.avi');
await worker.transcode('test.avi', 'test.mp4');
const { data } = await worker.read('test.mp4');
fs.writeFileSync('./test.mp4', data);
})();
`
``
$ npm install @ffmpeg/ffmpeg
> As we use worker_threads which was introduced in Node.js v10.5.0, please remember to add --experimental-worker` if you are using Node.js v10, and you don't have to add anything if you are using Node.js v12
- API
Learn how to build ffmpeg.js from stories:
- Part.1 Preparation
- Part.2 Compile with Emscripten
- Part.3 ffmpeg.js v0.1.0 — Transcoding avi to mp4
- Part.4 ffmpeg.js v0.2 — Web Worker and Libx264
- Part.5 ffmpeg.js v0.3 — pre-js and live streaming
- Part.6 a Deep Dive into File System