@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 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 ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
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
- const ffmpegInstallerPath = ffmpegInstaller.path;
49
- const ffprobeInstallerPath = ffprobeInstaller.path;
50
- if (ffmpegInstallerPath && fs.existsSync(ffmpegInstallerPath) && ffprobeInstallerPath && fs.existsSync(ffprobeInstallerPath)) {
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 (error) {
72
- // This is the only strategy, so if it fails, we throw.
73
- console.error('Failed to load FFmpeg/FFprobe from node_modules.', error);
74
- throw new n8n_workflow_1.NodeOperationError(
75
- // We can't use `this.getNode()` here as we are in a utility function.
76
- // A generic error is sufficient.
77
- { name: 'MediaFX', type: 'n8n-nodes-mediafx.mediaFX' }, 'Could not load the required FFmpeg executable from the package. ' +
78
- 'This might be due to a restricted execution environment or a broken installation. ' +
79
- 'Please check your n8n environment permissions. ' +
80
- `Original error: ${error.message}`);
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
- // If we get here, something went wrong, but the catch didn't trigger.
83
- console.error('FFmpeg binaries were not found in the expected package path.');
84
- return false;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lee-jisoo/n8n-nodes-mediafx",
3
- "version": "1.6.26",
3
+ "version": "1.6.27",
4
4
  "description": "N8N custom nodes for video editing and media processing (Enhanced fork with Speed control and Subtitle fixes)",
5
5
  "license": "MIT",
6
6
  "author": {