# Please visit [Kagami/ffmpeg.js](https://github.com/Kagami/ffmpeg.js/) if you are looking for ffmpeg.js
# ffmpeg.wasm [](https://img.shields.io/node/v/@ffmpeg/ffmpeg.svg) [](https://github.com/ffmpegwasm/ffmpeg.wasm/actions)  [](https://github.com/ffmpegwasm/ffmpeg.wasm/graphs/commit-activity) [](https://opensource.org/licenses/MIT) [](https://github.com/airbnb/javascript) [](https://www.npmjs.com/package/@ffmpeg/ffmpeg) [](https://www.npmjs.com/package/@ffmpeg/ffmpeg) Use FFmpeg directly in your browser without any backend services!! **Transcode**
[Source Code](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/examples/browser/transcode.html)
## Browsers support
| [
](http://godban.github.io/browsers-support-badges/)
| [Link](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/examples/browser/webcam.html) |
## 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:
```javascript
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):
```html
```
## Multi-thread
Starting from v0.8.0, multithreading is enabled and you can use this feature by passing `-threads