Add details to use other version of core.

This commit is contained in:
jeromewu 2020-11-12 10:24:32 +08:00 committed by GitHub
parent b16e362fc4
commit 036b22188a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,8 @@ Try it: [https://ffmpegwasm.github.io](https://ffmpegwasm.github.io#demo)
## Installation
**Node**
```
$ npm install @ffmpeg/ffmpeg @ffmpeg/core
```
@ -40,6 +42,8 @@ $ npm install @ffmpeg/ffmpeg @ffmpeg/core
$ node --experimental-wasm-threads --experimental-wasm-bulk-memory transcode.js
```
**Browser**
Or, using a script tag in the browser (only works in Chrome):
```html
@ -71,6 +75,36 @@ const ffmpeg = createFFmpeg({ log: true });
})();
```
### Use other version of ffmpeg.wasm-core / @ffmpeg/core
For each version of ffmpeg.wasm, there is a default version of @ffmpeg/core (you can find it in **devDependencies** section of [package.json](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/package.json)), but sometimes you may need to use newer version of @ffmpeg/core to use the latest/experimental features.
**Node**
Just install the specific version you need:
```bash
$ npm install @ffmpeg/core@latest
```
Or use your own version with customized path
```javascript
const ffmpeg = createFFmpeg({
corePath: '../../../src/ffmpeg-core.js',
});
```
**Browser**
```javascript
const ffmpeg = createFFmpeg({
corePath: 'https://unpkg.com/@ffmpeg/core@0.8.3/dist/ffmpeg-core.js',
});
```
For the list available versions and their changelog, please check: https://github.com/ffmpegwasm/ffmpeg.wasm-core/releases
## Multi-threading
Multi-threading need to be configured per external libraries, only following libraries supports it now: