Skip to content

Commit 45a29b0

Browse files
committed
Update README.md
1 parent 5ad350d commit 45a29b0

File tree

1 file changed

+15
-29
lines changed

1 file changed

+15
-29
lines changed

README.md

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Please visit [Kagami/ffmpeg.js](https://github.com/Kagami/ffmpeg.js/) if you are looking for ffmpeg.js
2-
3-
41
<p align="center">
52
<a href="#">
63
<img alt="ffmpeg.wasm" width="128px" height="128px" src="https://github.com/ffmpegwasm/ffmpeg.wasm/raw/master/docs/images/ffmpegwasm-icon.png">
@@ -18,7 +15,7 @@
1815
[![Downloads Total](https://img.shields.io/npm/dt/@ffmpeg/ffmpeg.svg)](https://www.npmjs.com/package/@ffmpeg/ffmpeg)
1916
[![Downloads Month](https://img.shields.io/npm/dm/@ffmpeg/ffmpeg.svg)](https://www.npmjs.com/package/@ffmpeg/ffmpeg)
2017

21-
Use FFmpeg directly in your browser without any backend services!!
18+
ffmpeg.wasm is a pure Webassembly / Javascript port of FFmpeg. It enables video & audio record, convert and stream right inside browsers.
2219

2320
**Transcode**
2421
<p align="center">
@@ -45,35 +42,33 @@ Use FFmpeg directly in your browser without any backend services!!
4542
| ---- | ------- | ----------- |
4643
| Webcam | <a href="https://codepen.io/jeromewu/pen/qBBKzyW" target="_blank"><img alt="codepen" width="128px" src="https://blog.codepen.io/wp-content/uploads/2012/06/[email protected]"></a> | [Link](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/examples/browser/webcam.html) |
4744

48-
## Supported Formats
45+
## Supported External Libraries
4946

50-
- mp4 (x264)
51-
- webm (vp8/vp9) (^0.8.0)
52-
- mp3 (^0.8.0)
47+
Check [HERE](https://github.com/ffmpegwasm/ffmpeg.wasm-core#configuration)
5348

5449
---
5550

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

5853
```javascript
5954
const fs = require('fs');
60-
const { createFFmpeg } = require('@ffmpeg/ffmpeg');
55+
const { createFFmpeg, fetchFile } = require('@ffmpeg/ffmpeg');
6156

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

6459
(async () => {
6560
await ffmpeg.load();
66-
await ffmpeg.write('test.avi', './test.avi');
61+
ffmpeg.FS('writeFile', 'test.avi', await fetchFile('./test.avi'));
6762
await ffmpeg.transcode('test.avi', 'test.mp4');
68-
fs.writeFileSync('./test.mp4', ffmpeg.read('test.mp4'));
63+
fs.writeFileSync('./test.mp4', ffmpeg.FS('readFile', 'test.mp4'));
6964
process.exit(0);
7065
})();
7166
```
7267

7368
## Installation
7469

7570
```
76-
$ npm install @ffmpeg/ffmpeg
71+
$ npm install @ffmpeg/ffmpeg @ffmpeg/core
7772
```
7873

7974
> As we are using the latest experimental features, you need to add few flags to run in Node.js
@@ -92,17 +87,17 @@ Or, using a script tag in the browser (only works in Chrome):
9287
</script>
9388
```
9489

95-
## Multi-thread
90+
## Multi-threading
9691

97-
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.
92+
Multi-threading need to be configured per external libraries, only following libraries supports it now:
9893

99-
```javascript
100-
// in transcode()
101-
await ffmpeg.transcode('flame.avi', 'flame.mp4', '-threads 2');
94+
### x264
10295

103-
// in run()
104-
await ffmpeg.run('-i flame.avi -threads 2 flame.mp4');
105-
```
96+
Run it multi-threading mode by default, no need to pass any arguments.
97+
98+
### libvpx / webm
99+
100+
Need to pass `-row-mt 1`, but can only use one thread to help, can speed up around 30%
106101

107102
## Examples
108103

@@ -111,12 +106,3 @@ await ffmpeg.run('-i flame.avi -threads 2 flame.mp4');
111106
## Documentation
112107

113108
- [API](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/docs/api.md)
114-
115-
## Tutorials
116-
117-
Learn how to build ffmpeg.wasm from stories:
118-
119-
- [Part.1 Preparation](https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-1-preparation/)
120-
- [Part.2 Compile with Emscripten](https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-2-compile-with-emscripten/)
121-
- [Part.3 ffmpeg.wasm v0.1— Transcoding avi to mp4](https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-3-v0.1/)
122-
- [Part.4 ffmpeg.wasm v0.2 — Web Worker and Libx264](https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-4-v0.2/)

0 commit comments

Comments
 (0)