n8n-nodes-sb-render 1.1.18 ā 1.2.0
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/LICENSE +21 -21
- package/README.md +474 -443
- package/dist/nodes/SbRender/sbrender.svg +7 -7
- package/dist/nodes/SbRender/services/AudioMixer.d.ts.map +1 -1
- package/dist/nodes/SbRender/services/AudioMixer.js +26 -11
- package/dist/nodes/SbRender/services/AudioMixer.js.map +1 -1
- package/dist/nodes/SbRender/services/AudioMixerSimple.d.ts +33 -0
- package/dist/nodes/SbRender/services/AudioMixerSimple.d.ts.map +1 -0
- package/dist/nodes/SbRender/services/AudioMixerSimple.js +122 -0
- package/dist/nodes/SbRender/services/AudioMixerSimple.js.map +1 -0
- package/dist/nodes/SbRender/services/SubtitleEngine.js +8 -8
- package/dist/nodes/SbRender/services/VideoComposer.d.ts.map +1 -1
- package/dist/nodes/SbRender/services/VideoComposer.js +167 -106
- package/dist/nodes/SbRender/services/VideoComposer.js.map +1 -1
- package/index.js +3 -3
- package/package.json +75 -73
- package/scripts/fix-ffprobe-permissions.js +114 -114
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Automatically set execute permissions on ffprobe binary after npm install
|
|
5
|
-
* This is required for @ffprobe-installer package to work correctly
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { chmodSync, existsSync, statSync } = require('fs');
|
|
9
|
-
const { resolve, join } = require('path');
|
|
10
|
-
const os = require('os');
|
|
11
|
-
|
|
12
|
-
// Detect current platform
|
|
13
|
-
const platform = os.platform();
|
|
14
|
-
const arch = os.arch();
|
|
15
|
-
|
|
16
|
-
console.log(`š Platform detected: ${platform}-${arch}`);
|
|
17
|
-
|
|
18
|
-
// Platform-specific binary paths
|
|
19
|
-
const getPlatformPath = () => {
|
|
20
|
-
const basePath = resolve(__dirname, '../node_modules/@ffprobe-installer');
|
|
21
|
-
|
|
22
|
-
if (platform === 'win32') {
|
|
23
|
-
return join(basePath, 'win32-x64/ffprobe.exe');
|
|
24
|
-
} else if (platform === 'darwin') {
|
|
25
|
-
if (arch === 'arm64') {
|
|
26
|
-
return join(basePath, 'darwin-arm64/ffprobe');
|
|
27
|
-
}
|
|
28
|
-
return join(basePath, 'darwin-x64/ffprobe');
|
|
29
|
-
} else if (platform === 'linux') {
|
|
30
|
-
if (arch === 'arm64') {
|
|
31
|
-
return join(basePath, 'linux-arm64/ffprobe');
|
|
32
|
-
}
|
|
33
|
-
return join(basePath, 'linux-x64/ffprobe');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return null;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// Try multiple possible paths where ffprobe might be installed
|
|
40
|
-
const possiblePaths = [
|
|
41
|
-
// Platform-specific path (primary)
|
|
42
|
-
getPlatformPath(),
|
|
43
|
-
// Fallback paths for different installations
|
|
44
|
-
resolve(__dirname, '../node_modules/@ffprobe-installer/linux-x64/ffprobe'),
|
|
45
|
-
resolve(__dirname, '../node_modules/@ffprobe-installer/darwin-x64/ffprobe'),
|
|
46
|
-
resolve(__dirname, '../node_modules/@ffprobe-installer/darwin-arm64/ffprobe'),
|
|
47
|
-
resolve(__dirname, '../node_modules/@ffprobe-installer/win32-x64/ffprobe.exe'),
|
|
48
|
-
// Nested dependency paths
|
|
49
|
-
resolve(__dirname, '../node_modules/@ffprobe-installer/ffprobe/node_modules/@ffprobe-installer/linux-x64/ffprobe'),
|
|
50
|
-
].filter(Boolean); // Remove null values
|
|
51
|
-
|
|
52
|
-
let successCount = 0;
|
|
53
|
-
let errorCount = 0;
|
|
54
|
-
|
|
55
|
-
console.log('š§ Fixing ffprobe permissions...');
|
|
56
|
-
|
|
57
|
-
for (const ffprobePath of possiblePaths) {
|
|
58
|
-
if (existsSync(ffprobePath)) {
|
|
59
|
-
try {
|
|
60
|
-
const stats = statSync(ffprobePath);
|
|
61
|
-
const currentMode = stats.mode;
|
|
62
|
-
|
|
63
|
-
console.log(` š Found: ${ffprobePath}`);
|
|
64
|
-
console.log(` š Current mode: ${(currentMode & parseInt('777', 8)).toString(8)}`);
|
|
65
|
-
|
|
66
|
-
// Set execute permissions (755 = rwxr-xr-x)
|
|
67
|
-
if (platform !== 'win32') {
|
|
68
|
-
chmodSync(ffprobePath, 0o755);
|
|
69
|
-
console.log(` ā
Set permissions to 755: ${ffprobePath}`);
|
|
70
|
-
} else {
|
|
71
|
-
console.log(` ā¹ļø Windows detected, permissions already OK: ${ffprobePath}`);
|
|
72
|
-
}
|
|
73
|
-
successCount++;
|
|
74
|
-
} catch (error) {
|
|
75
|
-
console.warn(` ā ļø Could not set permissions for ${ffprobePath}:`, error.message);
|
|
76
|
-
|
|
77
|
-
// Check if it's a permission error we can diagnose
|
|
78
|
-
if (error.code === 'EACCES') {
|
|
79
|
-
console.warn(' š” Suggestion: Try running as root/administrator or in Docker with proper permissions');
|
|
80
|
-
} else if (error.code === 'ENOENT') {
|
|
81
|
-
console.warn(' š” Suggestion: File may have been moved or deleted during installation');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
errorCount++;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
console.log(` ā Not found: ${ffprobePath}`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Summary and recommendations
|
|
92
|
-
console.log('\nš Summary:');
|
|
93
|
-
if (successCount === 0 && errorCount === 0) {
|
|
94
|
-
console.warn('ā ļø No ffprobe binaries found. This is normal if @ffprobe-installer is not yet installed.');
|
|
95
|
-
console.warn('\nš” If you encounter "EACCES" or "ENOENT" errors when running SB Render:');
|
|
96
|
-
console.warn(' 1. Ensure @ffprobe-installer is installed: npm ls @ffprobe-installer');
|
|
97
|
-
console.warn(' 2. For Linux/Docker: chmod +x node_modules/@ffprobe-installer/*/ffprobe');
|
|
98
|
-
console.warn(' 3. For n8n Cloud: Consider using system ffprobe instead');
|
|
99
|
-
} else if (successCount > 0) {
|
|
100
|
-
console.log(`ā
Successfully processed ${successCount} ffprobe binary(ies)`);
|
|
101
|
-
|
|
102
|
-
if (process.env.NODE_ENV === 'production' || process.env.N8N_CONFIG_FILES) {
|
|
103
|
-
console.log('\nš³ Docker/n8n environment detected. Additional tips:');
|
|
104
|
-
console.log(' - Ensure container has execute permissions on /tmp and node_modules');
|
|
105
|
-
console.log(' - Consider adding ffmpeg/ffprobe to your Docker image');
|
|
106
|
-
console.log(' - For n8n Cloud: System-level ffprobe may be required');
|
|
107
|
-
}
|
|
108
|
-
} else {
|
|
109
|
-
console.error('ā Failed to set permissions on any ffprobe binaries');
|
|
110
|
-
console.error('\nš§ Manual fix options:');
|
|
111
|
-
console.error(' 1. chmod +x node_modules/@ffprobe-installer/*/ffprobe');
|
|
112
|
-
console.error(' 2. Install system ffmpeg: apt-get install ffmpeg (Linux)');
|
|
113
|
-
console.error(' 3. Use Docker with proper --privileged or volume mounts');
|
|
114
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Automatically set execute permissions on ffprobe binary after npm install
|
|
5
|
+
* This is required for @ffprobe-installer package to work correctly
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { chmodSync, existsSync, statSync } = require('fs');
|
|
9
|
+
const { resolve, join } = require('path');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
|
|
12
|
+
// Detect current platform
|
|
13
|
+
const platform = os.platform();
|
|
14
|
+
const arch = os.arch();
|
|
15
|
+
|
|
16
|
+
console.log(`š Platform detected: ${platform}-${arch}`);
|
|
17
|
+
|
|
18
|
+
// Platform-specific binary paths
|
|
19
|
+
const getPlatformPath = () => {
|
|
20
|
+
const basePath = resolve(__dirname, '../node_modules/@ffprobe-installer');
|
|
21
|
+
|
|
22
|
+
if (platform === 'win32') {
|
|
23
|
+
return join(basePath, 'win32-x64/ffprobe.exe');
|
|
24
|
+
} else if (platform === 'darwin') {
|
|
25
|
+
if (arch === 'arm64') {
|
|
26
|
+
return join(basePath, 'darwin-arm64/ffprobe');
|
|
27
|
+
}
|
|
28
|
+
return join(basePath, 'darwin-x64/ffprobe');
|
|
29
|
+
} else if (platform === 'linux') {
|
|
30
|
+
if (arch === 'arm64') {
|
|
31
|
+
return join(basePath, 'linux-arm64/ffprobe');
|
|
32
|
+
}
|
|
33
|
+
return join(basePath, 'linux-x64/ffprobe');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Try multiple possible paths where ffprobe might be installed
|
|
40
|
+
const possiblePaths = [
|
|
41
|
+
// Platform-specific path (primary)
|
|
42
|
+
getPlatformPath(),
|
|
43
|
+
// Fallback paths for different installations
|
|
44
|
+
resolve(__dirname, '../node_modules/@ffprobe-installer/linux-x64/ffprobe'),
|
|
45
|
+
resolve(__dirname, '../node_modules/@ffprobe-installer/darwin-x64/ffprobe'),
|
|
46
|
+
resolve(__dirname, '../node_modules/@ffprobe-installer/darwin-arm64/ffprobe'),
|
|
47
|
+
resolve(__dirname, '../node_modules/@ffprobe-installer/win32-x64/ffprobe.exe'),
|
|
48
|
+
// Nested dependency paths
|
|
49
|
+
resolve(__dirname, '../node_modules/@ffprobe-installer/ffprobe/node_modules/@ffprobe-installer/linux-x64/ffprobe'),
|
|
50
|
+
].filter(Boolean); // Remove null values
|
|
51
|
+
|
|
52
|
+
let successCount = 0;
|
|
53
|
+
let errorCount = 0;
|
|
54
|
+
|
|
55
|
+
console.log('š§ Fixing ffprobe permissions...');
|
|
56
|
+
|
|
57
|
+
for (const ffprobePath of possiblePaths) {
|
|
58
|
+
if (existsSync(ffprobePath)) {
|
|
59
|
+
try {
|
|
60
|
+
const stats = statSync(ffprobePath);
|
|
61
|
+
const currentMode = stats.mode;
|
|
62
|
+
|
|
63
|
+
console.log(` š Found: ${ffprobePath}`);
|
|
64
|
+
console.log(` š Current mode: ${(currentMode & parseInt('777', 8)).toString(8)}`);
|
|
65
|
+
|
|
66
|
+
// Set execute permissions (755 = rwxr-xr-x)
|
|
67
|
+
if (platform !== 'win32') {
|
|
68
|
+
chmodSync(ffprobePath, 0o755);
|
|
69
|
+
console.log(` ā
Set permissions to 755: ${ffprobePath}`);
|
|
70
|
+
} else {
|
|
71
|
+
console.log(` ā¹ļø Windows detected, permissions already OK: ${ffprobePath}`);
|
|
72
|
+
}
|
|
73
|
+
successCount++;
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.warn(` ā ļø Could not set permissions for ${ffprobePath}:`, error.message);
|
|
76
|
+
|
|
77
|
+
// Check if it's a permission error we can diagnose
|
|
78
|
+
if (error.code === 'EACCES') {
|
|
79
|
+
console.warn(' š” Suggestion: Try running as root/administrator or in Docker with proper permissions');
|
|
80
|
+
} else if (error.code === 'ENOENT') {
|
|
81
|
+
console.warn(' š” Suggestion: File may have been moved or deleted during installation');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
errorCount++;
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
console.log(` ā Not found: ${ffprobePath}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Summary and recommendations
|
|
92
|
+
console.log('\nš Summary:');
|
|
93
|
+
if (successCount === 0 && errorCount === 0) {
|
|
94
|
+
console.warn('ā ļø No ffprobe binaries found. This is normal if @ffprobe-installer is not yet installed.');
|
|
95
|
+
console.warn('\nš” If you encounter "EACCES" or "ENOENT" errors when running SB Render:');
|
|
96
|
+
console.warn(' 1. Ensure @ffprobe-installer is installed: npm ls @ffprobe-installer');
|
|
97
|
+
console.warn(' 2. For Linux/Docker: chmod +x node_modules/@ffprobe-installer/*/ffprobe');
|
|
98
|
+
console.warn(' 3. For n8n Cloud: Consider using system ffprobe instead');
|
|
99
|
+
} else if (successCount > 0) {
|
|
100
|
+
console.log(`ā
Successfully processed ${successCount} ffprobe binary(ies)`);
|
|
101
|
+
|
|
102
|
+
if (process.env.NODE_ENV === 'production' || process.env.N8N_CONFIG_FILES) {
|
|
103
|
+
console.log('\nš³ Docker/n8n environment detected. Additional tips:');
|
|
104
|
+
console.log(' - Ensure container has execute permissions on /tmp and node_modules');
|
|
105
|
+
console.log(' - Consider adding ffmpeg/ffprobe to your Docker image');
|
|
106
|
+
console.log(' - For n8n Cloud: System-level ffprobe may be required');
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
console.error('ā Failed to set permissions on any ffprobe binaries');
|
|
110
|
+
console.error('\nš§ Manual fix options:');
|
|
111
|
+
console.error(' 1. chmod +x node_modules/@ffprobe-installer/*/ffprobe');
|
|
112
|
+
console.error(' 2. Install system ffmpeg: apt-get install ffmpeg (Linux)');
|
|
113
|
+
console.error(' 3. Use Docker with proper --privileged or volume mounts');
|
|
114
|
+
}
|