n8n-nodes-ffmpeg-wasm 1.2.7 → 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.
|
@@ -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
|
}
|