n8n-nodes-ffmpeg-wasm 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/FFmpegWasm/FFmpegWasm.node.js +37 -4
- package/node_modules/@ffmpeg/ffmpeg/.gitpod.Dockerfile +2 -0
- package/node_modules/@ffmpeg/ffmpeg/.gitpod.yml +7 -0
- package/node_modules/@ffmpeg/ffmpeg/.yarnrc.yml +4 -0
- package/node_modules/@ffmpeg/ffmpeg/CODE_OF_CONDUCT.md +76 -0
- package/node_modules/@ffmpeg/ffmpeg/CONTRIBUTING.md +1 -0
- package/node_modules/@ffmpeg/ffmpeg/LICENSE +21 -0
- package/node_modules/@ffmpeg/ffmpeg/README.md +202 -0
- package/node_modules/@ffmpeg/ffmpeg/_config.yml +1 -0
- package/node_modules/@ffmpeg/ffmpeg/dist/046d0074eee1d99a674a.js +1 -0
- package/node_modules/@ffmpeg/ffmpeg/dist/ffmpeg.min.js +2 -0
- package/node_modules/@ffmpeg/ffmpeg/dist/ffmpeg.min.js.map +1 -0
- package/node_modules/@ffmpeg/ffmpeg/package.json +73 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/server.js +25 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/test-helper.js +9 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/webpack.config.common.js +23 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/webpack.config.dev.js +27 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/webpack.config.prod.js +26 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/webpack.config.worker.dev.js +29 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/webpack.config.worker.prod.js +27 -0
- package/node_modules/@ffmpeg/ffmpeg/scripts/worker-server.js +25 -0
- package/node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js +10 -0
- package/node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js +38 -0
- package/node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js +114 -0
- package/node_modules/@ffmpeg/ffmpeg/src/browser/index.js +5 -0
- package/node_modules/@ffmpeg/ffmpeg/src/config.js +50 -0
- package/node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js +279 -0
- package/node_modules/@ffmpeg/ffmpeg/src/index.d.ts +120 -0
- package/node_modules/@ffmpeg/ffmpeg/src/index.js +36 -0
- package/node_modules/@ffmpeg/ffmpeg/src/node/defaultOptions.js +6 -0
- package/node_modules/@ffmpeg/ffmpeg/src/node/fetchFile.js +33 -0
- package/node_modules/@ffmpeg/ffmpeg/src/node/getCreateFFmpegCore.js +7 -0
- package/node_modules/@ffmpeg/ffmpeg/src/node/index.js +9 -0
- package/node_modules/@ffmpeg/ffmpeg/src/utils/errors.js +11 -0
- package/node_modules/@ffmpeg/ffmpeg/src/utils/log.js +24 -0
- package/node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js +10 -0
- package/node_modules/is-url/.travis.yml +3 -0
- package/node_modules/is-url/History.md +25 -0
- package/node_modules/is-url/LICENSE-MIT +19 -0
- package/node_modules/is-url/Readme.md +19 -0
- package/node_modules/is-url/index.js +47 -0
- package/node_modules/is-url/package.json +13 -0
- package/node_modules/is-url/test/index.js +149 -0
- package/node_modules/node-fetch/LICENSE.md +22 -0
- package/node_modules/node-fetch/README.md +634 -0
- package/node_modules/node-fetch/browser.js +25 -0
- package/node_modules/node-fetch/lib/index.es.js +1777 -0
- package/node_modules/node-fetch/lib/index.js +1787 -0
- package/node_modules/node-fetch/lib/index.mjs +1775 -0
- package/node_modules/node-fetch/package.json +89 -0
- package/node_modules/regenerator-runtime/LICENSE +21 -0
- package/node_modules/regenerator-runtime/README.md +31 -0
- package/node_modules/regenerator-runtime/package.json +19 -0
- package/node_modules/regenerator-runtime/path.js +11 -0
- package/node_modules/regenerator-runtime/runtime.js +761 -0
- package/node_modules/resolve-url/.jshintrc +44 -0
- package/node_modules/resolve-url/LICENSE +21 -0
- package/node_modules/resolve-url/bower.json +15 -0
- package/node_modules/resolve-url/changelog.md +15 -0
- package/node_modules/resolve-url/component.json +15 -0
- package/node_modules/resolve-url/package.json +34 -0
- package/node_modules/resolve-url/readme.md +83 -0
- package/node_modules/resolve-url/resolve-url.js +47 -0
- package/node_modules/resolve-url/test/resolve-url.js +70 -0
- package/node_modules/tr46/.npmignore +4 -0
- package/node_modules/tr46/index.js +193 -0
- package/node_modules/tr46/lib/.gitkeep +0 -0
- package/node_modules/tr46/lib/mappingTable.json +1 -0
- package/node_modules/tr46/package.json +31 -0
- package/node_modules/webidl-conversions/LICENSE.md +12 -0
- package/node_modules/webidl-conversions/README.md +53 -0
- package/node_modules/webidl-conversions/lib/index.js +189 -0
- package/node_modules/webidl-conversions/package.json +23 -0
- package/node_modules/whatwg-url/LICENSE.txt +21 -0
- package/node_modules/whatwg-url/README.md +67 -0
- package/node_modules/whatwg-url/lib/URL-impl.js +200 -0
- package/node_modules/whatwg-url/lib/URL.js +196 -0
- package/node_modules/whatwg-url/lib/public-api.js +11 -0
- package/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
- package/node_modules/whatwg-url/lib/utils.js +20 -0
- package/node_modules/whatwg-url/package.json +32 -0
- package/package.json +6 -2
|
@@ -960,6 +960,13 @@ class FFmpegWasm {
|
|
|
960
960
|
async execute() {
|
|
961
961
|
const items = this.getInputData();
|
|
962
962
|
const returnData = [];
|
|
963
|
+
try {
|
|
964
|
+
require.resolve("@ffmpeg/core");
|
|
965
|
+
}
|
|
966
|
+
catch {
|
|
967
|
+
throw new Error("FFmpeg.wasm core module (@ffmpeg/core) is not installed. " +
|
|
968
|
+
"Please uninstall and reinstall the n8n-nodes-ffmpeg-wasm community node.");
|
|
969
|
+
}
|
|
963
970
|
let corePath;
|
|
964
971
|
try {
|
|
965
972
|
const credentials = await this.getCredentials("ffmpegWasmApi");
|
|
@@ -979,7 +986,22 @@ class FFmpegWasm {
|
|
|
979
986
|
...(corePath ? { corePath } : {}),
|
|
980
987
|
});
|
|
981
988
|
try {
|
|
982
|
-
|
|
989
|
+
const globalAny = globalThis;
|
|
990
|
+
const savedFetch = globalAny.fetch;
|
|
991
|
+
try {
|
|
992
|
+
delete globalAny.fetch;
|
|
993
|
+
await ffmpeg.load();
|
|
994
|
+
}
|
|
995
|
+
catch (loadError) {
|
|
996
|
+
const msg = loadError instanceof Error
|
|
997
|
+
? loadError.message
|
|
998
|
+
: String(loadError);
|
|
999
|
+
throw new Error(`Failed to initialize FFmpeg.wasm: ${msg}. ` +
|
|
1000
|
+
`Ensure the n8n instance has sufficient memory (512MB+ recommended).`);
|
|
1001
|
+
}
|
|
1002
|
+
finally {
|
|
1003
|
+
globalAny.fetch = savedFetch;
|
|
1004
|
+
}
|
|
983
1005
|
for (let i = 0; i < items.length; i++) {
|
|
984
1006
|
try {
|
|
985
1007
|
const binaryPropertyName = this.getNodeParameter("binaryPropertyName", i);
|
|
@@ -999,7 +1021,10 @@ class FFmpegWasm {
|
|
|
999
1021
|
if (operation === "metadata") {
|
|
1000
1022
|
lastLogOutput = "";
|
|
1001
1023
|
try {
|
|
1002
|
-
await
|
|
1024
|
+
await Promise.race([
|
|
1025
|
+
ffmpeg.run("-i", inputFilename, "-hide_banner"),
|
|
1026
|
+
new Promise((resolve) => setTimeout(resolve, 10000)),
|
|
1027
|
+
]);
|
|
1003
1028
|
}
|
|
1004
1029
|
catch {
|
|
1005
1030
|
}
|
|
@@ -1738,7 +1763,10 @@ class FFmpegWasm {
|
|
|
1738
1763
|
const outputName = `${outputFilename}${outputExt}`;
|
|
1739
1764
|
lastLogOutput = "";
|
|
1740
1765
|
try {
|
|
1741
|
-
await
|
|
1766
|
+
await Promise.race([
|
|
1767
|
+
ffmpeg.run("-i", inputFilename, "-hide_banner"),
|
|
1768
|
+
new Promise((resolve) => setTimeout(resolve, 10000)),
|
|
1769
|
+
]);
|
|
1742
1770
|
}
|
|
1743
1771
|
catch {
|
|
1744
1772
|
}
|
|
@@ -1826,7 +1854,12 @@ class FFmpegWasm {
|
|
|
1826
1854
|
}
|
|
1827
1855
|
}
|
|
1828
1856
|
finally {
|
|
1829
|
-
ffmpeg.
|
|
1857
|
+
if (ffmpeg.isLoaded()) {
|
|
1858
|
+
try {
|
|
1859
|
+
ffmpeg.exit();
|
|
1860
|
+
}
|
|
1861
|
+
catch { }
|
|
1862
|
+
}
|
|
1830
1863
|
}
|
|
1831
1864
|
return [returnData];
|
|
1832
1865
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at jeromewus@gmail.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
72
|
+
|
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
|
74
|
+
|
|
75
|
+
For answers to common questions about this code of conduct, see
|
|
76
|
+
https://www.contributor-covenant.org/faq
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
WIP
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Jerome Wu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="#">
|
|
3
|
+
<img alt="ffmpeg.wasm" width="128px" height="128px" src="https://github.com/ffmpegwasm/ffmpeg.wasm/raw/master/docs/images/ffmpegwasm-icon.png">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# ffmpeg.wasm
|
|
8
|
+
|
|
9
|
+
[](https://github.com/emersion/stability-badges#experimental)
|
|
10
|
+
[](https://img.shields.io/node/v/@ffmpeg/ffmpeg.svg)
|
|
11
|
+
[](https://github.com/ffmpegwasm/ffmpeg.wasm/actions)
|
|
12
|
+

|
|
13
|
+

|
|
14
|
+
[](https://github.com/ffmpegwasm/ffmpeg.wasm/graphs/commit-activity)
|
|
15
|
+
[](https://opensource.org/licenses/MIT)
|
|
16
|
+
[](https://github.com/airbnb/javascript)
|
|
17
|
+
[](https://www.npmjs.com/package/@ffmpeg/ffmpeg)
|
|
18
|
+
[](https://www.npmjs.com/package/@ffmpeg/ffmpeg)
|
|
19
|
+
|
|
20
|
+
Join us on Discord!
|
|
21
|
+
|
|
22
|
+
[](https://discord.gg/NjGMaqqfm5)
|
|
23
|
+
|
|
24
|
+
ffmpeg.wasm is a pure Webassembly / Javascript port of FFmpeg. It enables video & audio record, convert and stream right inside browsers.
|
|
25
|
+
|
|
26
|
+
**AVI to MP4 Demo**
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="#">
|
|
29
|
+
<img alt="transcode-demo" src="https://github.com/ffmpegwasm/ffmpeg.wasm/raw/master/docs/images/transcode.gif">
|
|
30
|
+
</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
Try it: [https://ffmpegwasm.netlify.app](https://ffmpegwasm.netlify.app#demo)
|
|
34
|
+
|
|
35
|
+
Check next steps of ffmpeg.wasm [HERE](https://github.com/ffmpegwasm/ffmpeg.wasm/discussions/415)
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
**Node**
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
$ npm install @ffmpeg/ffmpeg @ffmpeg/core
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> As we are using experimental features, you need to add flags to run in Node.js
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
$ node --experimental-wasm-threads transcode.js
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Browser**
|
|
52
|
+
|
|
53
|
+
Or, using a script tag in the browser (only works in some browsers, see list below):
|
|
54
|
+
|
|
55
|
+
> SharedArrayBuffer is only available to pages that are [cross-origin isolated](https://developer.chrome.com/blog/enabling-shared-array-buffer/#cross-origin-isolation). So you need to host [your own server](https://github.com/ffmpegwasm/ffmpegwasm.github.io/blob/main/server/server.js) with `Cross-Origin-Embedder-Policy: require-corp` and `Cross-Origin-Opener-Policy: same-origin` headers to use ffmpeg.wasm.
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<script src="static/js/ffmpeg.min.js"></script>
|
|
59
|
+
<script>
|
|
60
|
+
const { createFFmpeg } = FFmpeg;
|
|
61
|
+
...
|
|
62
|
+
</script>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> Only browsers with SharedArrayBuffer support can use ffmpeg.wasm, you can check [HERE](https://caniuse.com/sharedarraybuffer) for the complete list.
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
ffmpeg.wasm provides simple to use APIs, to transcode a video you only need few lines of code:
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
import { writeFile } from 'fs/promises';
|
|
73
|
+
import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
|
|
74
|
+
|
|
75
|
+
const ffmpeg = createFFmpeg({ log: true });
|
|
76
|
+
|
|
77
|
+
(async () => {
|
|
78
|
+
await ffmpeg.load();
|
|
79
|
+
ffmpeg.FS('writeFile', 'test.avi', await fetchFile('./test.avi'));
|
|
80
|
+
await ffmpeg.run('-i', 'test.avi', 'test.mp4');
|
|
81
|
+
await fs.promises.writeFile('./test.mp4', ffmpeg.FS('readFile', 'test.mp4'));
|
|
82
|
+
process.exit(0);
|
|
83
|
+
})();
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Use other version of ffmpeg.wasm-core / @ffmpeg/core
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
|
|
90
|
+
**Node**
|
|
91
|
+
|
|
92
|
+
Just install the specific version you need:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
$ npm install @ffmpeg/core@latest
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Or use your own version with customized path
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
const ffmpeg = createFFmpeg({
|
|
102
|
+
corePath: '../../../src/ffmpeg-core.js',
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Browser**
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
const ffmpeg = createFFmpeg({
|
|
110
|
+
corePath: 'static/js/ffmpeg-core.js',
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Keep in mind that for compatibility with webworkers and nodejs this will default to a local path, so it will attempt to look for `'static/js/ffmpeg.core.js'` locally, often resulting in a local resource error. If you wish to use a core version hosted on your own domain, you might reference it relatively like this:
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
const ffmpeg = createFFmpeg({
|
|
118
|
+
corePath: new URL('static/js/ffmpeg-core.js', document.location).href,
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For the list available versions and their changelog, please check: https://github.com/ffmpegwasm/ffmpeg.wasm-core/releases
|
|
123
|
+
|
|
124
|
+
### Use single thread version
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
const ffmpeg = createFFmpeg({
|
|
128
|
+
mainName: 'main',
|
|
129
|
+
corePath: 'https://unpkg.com/@ffmpeg/core-st@0.11.1/dist/ffmpeg-core.js',
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Multi-threading
|
|
134
|
+
|
|
135
|
+
Multi-threading need to be configured per external libraries, only following libraries supports it now:
|
|
136
|
+
|
|
137
|
+
### x264
|
|
138
|
+
|
|
139
|
+
Run it multi-threading mode by default, no need to pass any arguments.
|
|
140
|
+
|
|
141
|
+
### libvpx / webm
|
|
142
|
+
|
|
143
|
+
Need to pass `-row-mt 1`, but can only use one thread to help, can speed up around 30%
|
|
144
|
+
|
|
145
|
+
## Documentation
|
|
146
|
+
|
|
147
|
+
- [API](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/docs/api.md)
|
|
148
|
+
- [Supported External Libraries](https://github.com/ffmpegwasm/ffmpeg.wasm-core#configuration)
|
|
149
|
+
|
|
150
|
+
## FAQ
|
|
151
|
+
|
|
152
|
+
### What is the license of ffmpeg.wasm?
|
|
153
|
+
|
|
154
|
+
There are two components inside ffmpeg.wasm:
|
|
155
|
+
|
|
156
|
+
- @ffmpeg/ffmpeg (https://github.com/ffmpegwasm/ffmpeg.wasm)
|
|
157
|
+
- @ffmpeg/core (https://github.com/ffmpegwasm/ffmpeg.wasm-core)
|
|
158
|
+
|
|
159
|
+
@ffmpeg/core contains WebAssembly code which is transpiled from original FFmpeg C code with minor modifications, but overall it still following the same licenses as FFmpeg and its external libraries (as each external libraries might have its own license).
|
|
160
|
+
|
|
161
|
+
@ffmpeg/ffmpeg contains kind of a wrapper to handle the complexity of loading core and calling low-level APIs. It is a small code base and under MIT license.
|
|
162
|
+
|
|
163
|
+
### Can I use ffmpeg.wasm in Firefox?
|
|
164
|
+
|
|
165
|
+
Yes, but only for Firefox 79+ with proper header in both client and server, visit https://ffmpegwasm.netlify.app to try whether your Firefox works.
|
|
166
|
+
|
|
167
|
+

|
|
168
|
+
|
|
169
|
+
For more details: https://github.com/ffmpegwasm/ffmpeg.wasm/issues/106
|
|
170
|
+
|
|
171
|
+
### What is the maximum size of input file?
|
|
172
|
+
|
|
173
|
+
2 GB, which is a hard limit in WebAssembly. Might become 4 GB in the future.
|
|
174
|
+
|
|
175
|
+
### How can I build my own ffmpeg.wasm?
|
|
176
|
+
|
|
177
|
+
In fact, it is ffmpeg.wasm-core most people would like to build.
|
|
178
|
+
|
|
179
|
+
To build on your own, you can check build.sh inside https://github.com/ffmpegwasm/ffmpeg.wasm-core repository.
|
|
180
|
+
|
|
181
|
+
Also you can check this series of posts to learn more fundamental concepts:
|
|
182
|
+
|
|
183
|
+
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-1-preparation/
|
|
184
|
+
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-2-compile-with-emscripten/
|
|
185
|
+
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-3-v0.1/
|
|
186
|
+
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-4-v0.2/
|
|
187
|
+
|
|
188
|
+
### Why it doesn't work in my local environment?
|
|
189
|
+
|
|
190
|
+
When calling `ffmpeg.load()`, by default it looks for `http://localhost:3000/node_modules/@ffmpeg/core/dist/` to download essential files (ffmpeg-core.js, ffmpeg-core.wasm, ffmpeg-core.worker.js). It is necessary to make sure you have those files served there.
|
|
191
|
+
|
|
192
|
+
If you have those files serving in other location, you can rewrite the default behavior when calling `createFFmpeg()`:
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
const { createFFmpeg } = FFmpeg;
|
|
196
|
+
const ffmpeg = createFFmpeg({
|
|
197
|
+
corePath: "http://localhost:3000/public/ffmpeg-core.js",
|
|
198
|
+
// Use public address if you don't want to host your own.
|
|
199
|
+
// corePath: 'https://unpkg.com/@ffmpeg/core@0.10.0/dist/ffmpeg-core.js'
|
|
200
|
+
log: true,
|
|
201
|
+
});
|
|
202
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
theme: jekyll-theme-cayman
|