@lee-jisoo/n8n-nodes-mediafx 1.6.26 → 1.6.27
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/README.md +8 -0
- package/dist/nodes/MediaFX/utils.js +61 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,14 @@ This is a custom n8n node for comprehensive, local media processing using FFmpeg
|
|
|
10
10
|
|
|
11
11
|
## 🆕 What's New in This Fork
|
|
12
12
|
|
|
13
|
+
### v1.6.27
|
|
14
|
+
**Improvements**
|
|
15
|
+
|
|
16
|
+
- **🔧 FFmpeg Bundling Fix**: Now uses `ffmpeg-static` (FFmpeg 5.x) as primary source
|
|
17
|
+
- More reliable cross-platform support
|
|
18
|
+
- Fixes issues with old system FFmpeg being used instead of bundled version
|
|
19
|
+
- All advanced features (text_align, line_spacing) now work properly
|
|
20
|
+
|
|
13
21
|
### v1.6.26
|
|
14
22
|
**New Features**
|
|
15
23
|
|
|
@@ -40,48 +40,74 @@ let ffmpegInitialized = false;
|
|
|
40
40
|
function tryInitializeFfmpeg() {
|
|
41
41
|
if (ffmpegInitialized)
|
|
42
42
|
return true;
|
|
43
|
+
let ffmpegBinaryPath = null;
|
|
44
|
+
let ffprobeBinaryPath = null;
|
|
45
|
+
// Strategy 1: Try ffmpeg-static (recommended, includes FFmpeg 5.x+)
|
|
43
46
|
try {
|
|
44
47
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
45
|
-
const
|
|
48
|
+
const ffmpegStatic = require('ffmpeg-static');
|
|
49
|
+
if (ffmpegStatic && fs.existsSync(ffmpegStatic)) {
|
|
50
|
+
ffmpegBinaryPath = ffmpegStatic;
|
|
51
|
+
console.log(`FFmpeg found via ffmpeg-static: ${ffmpegStatic}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
console.warn('ffmpeg-static not available, trying fallback...');
|
|
56
|
+
}
|
|
57
|
+
// Strategy 2: Fallback to @ffmpeg-installer/ffmpeg
|
|
58
|
+
if (!ffmpegBinaryPath) {
|
|
59
|
+
try {
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
61
|
+
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
|
|
62
|
+
if (ffmpegInstaller.path && fs.existsSync(ffmpegInstaller.path)) {
|
|
63
|
+
ffmpegBinaryPath = ffmpegInstaller.path;
|
|
64
|
+
console.log(`FFmpeg found via @ffmpeg-installer: ${ffmpegInstaller.path}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.warn('@ffmpeg-installer/ffmpeg not available');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Get ffprobe from @ffprobe-installer/ffprobe
|
|
72
|
+
try {
|
|
46
73
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
47
74
|
const ffprobeInstaller = require('@ffprobe-installer/ffprobe');
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// Set executable permissions dynamically
|
|
52
|
-
if (os.platform() !== 'win32') {
|
|
53
|
-
try {
|
|
54
|
-
fs.chmodSync(ffmpegInstallerPath, '755');
|
|
55
|
-
fs.chmodSync(ffprobeInstallerPath, '755');
|
|
56
|
-
console.log('Dynamically set permissions for ffmpeg and ffprobe.');
|
|
57
|
-
}
|
|
58
|
-
catch (permissionError) {
|
|
59
|
-
console.warn('Failed to set executable permissions dynamically:', permissionError);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
ffmpeg.setFfmpegPath(ffmpegInstallerPath);
|
|
63
|
-
ffmpeg.setFfprobePath(ffprobeInstallerPath);
|
|
64
|
-
ffmpegPath = ffmpegInstallerPath;
|
|
65
|
-
ffmpegInitialized = true;
|
|
66
|
-
console.log(`FFmpeg initialized with @ffmpeg-installer: ${ffmpegInstallerPath}`);
|
|
67
|
-
console.log(`FFprobe initialized with @ffprobe-installer: ${ffprobeInstallerPath}`);
|
|
68
|
-
return true;
|
|
75
|
+
if (ffprobeInstaller.path && fs.existsSync(ffprobeInstaller.path)) {
|
|
76
|
+
ffprobeBinaryPath = ffprobeInstaller.path;
|
|
77
|
+
console.log(`FFprobe found via @ffprobe-installer: ${ffprobeInstaller.path}`);
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
|
-
catch (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{ name: 'MediaFX', type: 'n8n-nodes-mediafx.mediaFX' }, 'Could not
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
catch (e) {
|
|
81
|
+
console.warn('@ffprobe-installer/ffprobe not available');
|
|
82
|
+
}
|
|
83
|
+
// Validate and set paths
|
|
84
|
+
if (!ffmpegBinaryPath) {
|
|
85
|
+
console.error('FFmpeg binary not found in any package.');
|
|
86
|
+
throw new n8n_workflow_1.NodeOperationError({ name: 'MediaFX', type: 'n8n-nodes-mediafx.mediaFX' }, 'Could not find FFmpeg executable. Please ensure ffmpeg-static or @ffmpeg-installer/ffmpeg is properly installed.');
|
|
87
|
+
}
|
|
88
|
+
if (!ffprobeBinaryPath) {
|
|
89
|
+
console.error('FFprobe binary not found.');
|
|
90
|
+
throw new n8n_workflow_1.NodeOperationError({ name: 'MediaFX', type: 'n8n-nodes-mediafx.mediaFX' }, 'Could not find FFprobe executable. Please ensure @ffprobe-installer/ffprobe is properly installed.');
|
|
81
91
|
}
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
// Set executable permissions on non-Windows systems
|
|
93
|
+
if (os.platform() !== 'win32') {
|
|
94
|
+
try {
|
|
95
|
+
fs.chmodSync(ffmpegBinaryPath, '755');
|
|
96
|
+
fs.chmodSync(ffprobeBinaryPath, '755');
|
|
97
|
+
console.log('Set executable permissions for ffmpeg and ffprobe.');
|
|
98
|
+
}
|
|
99
|
+
catch (permissionError) {
|
|
100
|
+
console.warn('Failed to set executable permissions:', permissionError);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Configure fluent-ffmpeg
|
|
104
|
+
ffmpeg.setFfmpegPath(ffmpegBinaryPath);
|
|
105
|
+
ffmpeg.setFfprobePath(ffprobeBinaryPath);
|
|
106
|
+
ffmpegPath = ffmpegBinaryPath;
|
|
107
|
+
ffmpegInitialized = true;
|
|
108
|
+
console.log(`FFmpeg initialized: ${ffmpegBinaryPath}`);
|
|
109
|
+
console.log(`FFprobe initialized: ${ffprobeBinaryPath}`);
|
|
110
|
+
return true;
|
|
85
111
|
}
|
|
86
112
|
// Try to initialize FFmpeg on module load
|
|
87
113
|
tryInitializeFfmpeg();
|
package/package.json
CHANGED