n8n-nodes-sb-render 1.1.3 → 1.1.5

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
@@ -1,442 +1,442 @@
1
- # n8n-nodes-sb-render
2
-
3
- [![npm version](https://badge.fury.io/js/n8n-nodes-sb-render.svg)](https://badge.fury.io/js/n8n-nodes-sb-render)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
-
6
- This is an n8n community node for video rendering with customizable subtitles, background music (BGM), and narration using FFmpeg.
7
-
8
- **sb-render** allows you to automate video composition workflows in n8n, combining video files with:
9
- - 🎵 Background music with volume control and fade effects
10
- - 🎙️ Narration audio with timing control
11
- - 📝 Customizable subtitles with extensive styling options
12
- - 🎨 Multiple output formats and quality presets
13
-
14
- Inspired by [n8n-nodes-mediafx](https://github.com/dandacompany/n8n-nodes-mediafx).
15
-
16
- ## Table of Contents
17
-
18
- - [Installation](#installation)
19
- - [Prerequisites](#prerequisites)
20
- - [Operations](#operations)
21
- - [Configuration](#configuration)
22
- - [Examples](#examples)
23
- - [Development](#development)
24
- - [Troubleshooting](#troubleshooting)
25
- - [License](#license)
26
-
27
- ## Installation
28
-
29
- ### Community Nodes (Recommended)
30
-
31
- 1. Go to **Settings > Community Nodes** in n8n
32
- 2. Select **Install**
33
- 3. Enter `n8n-nodes-sb-render`
34
- 4. Agree to the risks and install
35
-
36
- ### Manual Installation
37
-
38
- ```bash
39
- npm install n8n-nodes-sb-render
40
- ```
41
-
42
- For n8n self-hosted installations:
43
-
44
- ```bash
45
- cd ~/.n8n
46
- npm install n8n-nodes-sb-render
47
- # Restart n8n
48
- ```
49
-
50
- ## Prerequisites
51
-
52
- - **n8n version**: 1.0.0 or higher
53
- - **Node.js**: 16.0.0 or higher
54
- - **FFmpeg**: Automatically installed via `@ffmpeg-installer/ffmpeg`
55
-
56
- ## Operations
57
-
58
- ### Video → Render
59
-
60
- Compose a video with optional background music, narration, and subtitles.
61
-
62
- **Features:**
63
- - ✅ Multiple input sources (URL or binary data)
64
- - ✅ Audio mixing with independent volume controls
65
- - ✅ Fade in/out effects for BGM
66
- - ✅ Customizable subtitle positioning and styling
67
- - ✅ Multiple output formats (MP4, MOV, WebM)
68
- - ✅ Quality presets (Low, Medium, High, Custom)
69
-
70
- ## Configuration
71
-
72
- ### Video Input
73
-
74
- | Parameter | Type | Required | Description |
75
- |-----------|------|----------|-------------|
76
- | **Video Source** | Options | Yes | `url` or `binary` |
77
- | **Video URL** | String | If URL | URL of the video file |
78
- | **Video Binary Property** | String | If Binary | Name of binary property containing video |
79
-
80
- ### Background Music (BGM)
81
-
82
- | Parameter | Type | Default | Description |
83
- |-----------|------|---------|-------------|
84
- | **Enable BGM** | Boolean | false | Add background music |
85
- | **BGM Source** | Options | - | `url` or `binary` |
86
- | **BGM URL** | String | - | URL of BGM file |
87
- | **BGM Volume** | Number | 30 | Volume 0-100 |
88
- | **BGM Fade In** | Number | 2 | Fade-in duration (seconds) |
89
- | **BGM Fade Out** | Number | 2 | Fade-out duration (seconds) |
90
-
91
- ### Narration
92
-
93
- | Parameter | Type | Default | Description |
94
- |-----------|------|---------|-------------|
95
- | **Enable Narration** | Boolean | false | Add narration audio |
96
- | **Narration Source** | Options | - | `url` or `binary` |
97
- | **Narration URL** | String | - | URL of narration file |
98
- | **Narration Volume** | Number | 80 | Volume 0-100 |
99
- | **Narration Delay** | Number | 0 | Delay before start (seconds) |
100
-
101
- ### Subtitles
102
-
103
- | Parameter | Type | Default | Description |
104
- |-----------|------|---------|-------------|
105
- | **Enable Subtitles** | Boolean | false | Add subtitles |
106
- | **Text** | String | - | Subtitle text content |
107
- | **Start Time** | Number | - | Start time in seconds |
108
- | **End Time** | Number | - | End time in seconds |
109
- | **Position** | Options | bottom | `top`, `middle`, `bottom`, `custom` |
110
- | **Font Size** | Number | 48 | Text size |
111
- | **Font Color** | Color | #FFFFFF | Text color (hex) |
112
- | **Font Family** | String | Arial | Font name |
113
- | **Alignment** | Options | center | `left`, `center`, `right` |
114
- | **Background Color** | Color | #000000 | Background color (hex) |
115
- | **Background Opacity** | Number | 80 | Opacity 0-100 |
116
- | **Border Color** | Color | #000000 | Border color (hex) |
117
- | **Border Width** | Number | 2 | Border width (pixels) |
118
-
119
- ### Output Options
120
-
121
- | Parameter | Type | Default | Description |
122
- |-----------|------|---------|-------------|
123
- | **Output Format** | Options | mp4 | `mp4`, `mov`, `webm` |
124
- | **Video Codec** | Options | libx264 | `libx264`, `libx265`, `vp9` |
125
- | **Quality** | Options | high | `low`, `medium`, `high`, `custom` |
126
- | **Custom CRF** | Number | 18 | CRF value 0-51 (if custom quality) |
127
- | **Output Binary Property** | String | data | Property name for output |
128
-
129
- ## Examples
130
-
131
- ### Example 1: Simple Video with Subtitles
132
-
133
- ```json
134
- {
135
- "videoSource": "url",
136
- "videoUrl": "https://example.com/video.mp4",
137
- "enableSubtitles": true,
138
- "subtitles": {
139
- "subtitle": [
140
- {
141
- "text": "Welcome to our video!",
142
- "startTime": 0,
143
- "endTime": 5,
144
- "position": "bottom",
145
- "fontSize": 48,
146
- "fontColor": "#FFFFFF",
147
- "alignment": "center"
148
- }
149
- ]
150
- },
151
- "outputFormat": "mp4",
152
- "quality": "high"
153
- }
154
- ```
155
-
156
- ### Example 2: Video with BGM and Narration
157
-
158
- ```json
159
- {
160
- "videoSource": "url",
161
- "videoUrl": "https://example.com/video.mp4",
162
- "enableBGM": true,
163
- "bgmSource": "url",
164
- "bgmUrl": "https://example.com/music.mp3",
165
- "bgmVolume": 20,
166
- "bgmFadeIn": 3,
167
- "bgmFadeOut": 3,
168
- "enableNarration": true,
169
- "narrationSource": "url",
170
- "narrationUrl": "https://example.com/narration.mp3",
171
- "narrationVolume": 90,
172
- "narrationDelay": 2,
173
- "outputFormat": "mp4"
174
- }
175
- ```
176
-
177
- ### Example 3: Custom Positioned Subtitles
178
-
179
- ```json
180
- {
181
- "videoSource": "url",
182
- "videoUrl": "https://example.com/video.mp4",
183
- "enableSubtitles": true,
184
- "subtitles": {
185
- "subtitle": [
186
- {
187
- "text": "Top-left subtitle",
188
- "startTime": 0,
189
- "endTime": 5,
190
- "position": "custom",
191
- "customX": 100,
192
- "customY": 100,
193
- "fontSize": 36,
194
- "fontColor": "#FFFF00",
195
- "alignment": "left",
196
- "backgroundColor": "#000000",
197
- "backgroundOpacity": 70,
198
- "borderColor": "#FFFFFF",
199
- "borderWidth": 3
200
- }
201
- ]
202
- }
203
- }
204
- ```
205
-
206
- ### Example 4: Workflow Integration
207
-
208
- **Scenario**: Download video from URL, add BGM and subtitles, upload to cloud storage
209
-
210
- ```
211
- HTTP Request → SB Render → Google Drive
212
- ```
213
-
214
- 1. **HTTP Request**: Download video file
215
- 2. **SB Render**: Add BGM and subtitles
216
- 3. **Google Drive**: Upload rendered video
217
-
218
- ## Development
219
-
220
- ### Build
221
-
222
- ```bash
223
- npm install
224
- npm run build
225
- ```
226
-
227
- ### Development Mode
228
-
229
- ```bash
230
- npm run dev
231
- ```
232
-
233
- ### Linting
234
-
235
- ```bash
236
- npm run lint
237
- npm run lintfix
238
- ```
239
-
240
- ### Project Structure
241
-
242
- ```
243
- sb-render/
244
- ├── nodes/
245
- │ └── SbRender/
246
- │ ├── SbRender.node.ts # Main node implementation
247
- │ ├── SbRender.node.json # Node metadata
248
- │ ├── services/
249
- │ │ ├── FileManager.ts # File handling
250
- │ │ ├── AudioMixer.ts # Audio composition
251
- │ │ ├── SubtitleEngine.ts # Subtitle generation
252
- │ │ └── VideoComposer.ts # Video rendering
253
- │ ├── interfaces/
254
- │ │ └── index.ts # TypeScript types
255
- │ └── utils/
256
- │ ├── ffmpeg.ts # FFmpeg helpers
257
- │ └── validation.ts # Input validation
258
- ├── fonts/ # Custom fonts
259
- ├── package.json
260
- ├── tsconfig.json
261
- └── README.md
262
- ```
263
-
264
- ## Troubleshooting
265
-
266
- ### FFmpeg Not Found
267
-
268
- The node automatically installs FFmpeg via `@ffmpeg-installer/ffmpeg`. If you encounter issues:
269
-
270
- ```bash
271
- npm install @ffmpeg-installer/ffmpeg --force
272
- ```
273
-
274
- ### File Download Errors
275
-
276
- **Issue**: Video/audio URLs fail to download
277
-
278
- **Solutions**:
279
- - Verify URL accessibility
280
- - Check for authentication requirements
281
- - Ensure sufficient disk space
282
- - Try using binary data input instead
283
-
284
- ### Subtitle Not Appearing
285
-
286
- **Issue**: Subtitles don't show in output video
287
-
288
- **Solutions**:
289
- - Verify timing (start/end times within video duration)
290
- - Check subtitle position and size
291
- - Ensure font is available on system
292
- - Try different output format (MP4 recommended)
293
-
294
- ### Memory Issues
295
-
296
- **Issue**: Process crashes with large video files
297
-
298
- **Solutions**:
299
- - Reduce video resolution before processing
300
- - Use lower quality preset
301
- - Process videos in smaller batches
302
- - Increase Node.js memory limit:
303
-
304
- ```bash
305
- export NODE_OPTIONS="--max-old-space-size=4096"
306
- ```
307
-
308
- ### Audio Sync Issues
309
-
310
- **Issue**: Audio out of sync with video
311
-
312
- **Solutions**:
313
- - Ensure all audio files are in compatible formats
314
- - Check narration delay settings
315
- - Verify video frame rate compatibility
316
- - Try re-encoding source files
317
-
318
- ## Technical Details
319
-
320
- ### FFmpeg Commands
321
-
322
- The node uses **fluent-ffmpeg** to construct FFmpeg commands:
323
-
324
- **Audio Mixing**:
325
- ```bash
326
- -filter_complex "[0:a]volume=1.0[original];[1:a]volume=0.3,afade=t=in:st=0:d=2[bgm];[original][bgm]amix=inputs=2[mixed]"
327
- ```
328
-
329
- **Subtitle Overlay**:
330
- ```bash
331
- -vf "ass=subtitles.ass"
332
- ```
333
-
334
- **Complete Command**:
335
- ```bash
336
- ffmpeg -i video.mp4 -i bgm.mp3 -filter_complex "..." -vf "ass=..." -c:v libx264 -crf 18 output.mp4
337
- ```
338
-
339
- ### Subtitle Formats
340
-
341
- - **SRT**: Simple subtitle format (limited styling)
342
- - **ASS**: Advanced SubStation Alpha (full styling support) ← **Used by default**
343
-
344
- ASS format provides:
345
- - Custom fonts and colors
346
- - Precise positioning
347
- - Background colors and opacity
348
- - Border/outline effects
349
- - Multiple alignment options
350
-
351
- ## Performance
352
-
353
- ### Resource Usage
354
-
355
- | Video Length | Memory | Processing Time |
356
- |--------------|--------|-----------------|
357
- | 1 minute | ~200MB | ~30 seconds |
358
- | 5 minutes | ~500MB | ~2 minutes |
359
- | 10 minutes | ~1GB | ~5 minutes |
360
-
361
- *Times measured on standard VPS (2 CPU, 4GB RAM)*
362
-
363
- ### Optimization Tips
364
-
365
- 1. **Use appropriate quality**: High quality for final output, medium for testing
366
- 2. **Compress BGM**: Use lower bitrate audio files (128-192 kbps)
367
- 3. **Batch processing**: Process multiple videos in parallel workflows
368
- 4. **Cache audio files**: Reuse same BGM/narration across multiple videos
369
-
370
- ## Compatibility
371
-
372
- ### Supported Video Formats
373
-
374
- **Input**: MP4, MOV, WebM, AVI, MKV
375
- **Output**: MP4, MOV, WebM
376
-
377
- ### Supported Audio Formats
378
-
379
- **Input**: MP3, WAV, AAC, OGG, M4A
380
- **Output**: AAC (default)
381
-
382
- ### Codec Compatibility
383
-
384
- | Codec | Quality | Speed | Browser Support |
385
- |-------|---------|-------|-----------------|
386
- | H.264 (libx264) | Good | Fast | Excellent |
387
- | H.265 (libx265) | Better | Slower | Limited |
388
- | VP9 | Good | Slow | Good (WebM) |
389
-
390
- ## Contributing
391
-
392
- Contributions are welcome! Please:
393
-
394
- 1. Fork the repository
395
- 2. Create a feature branch
396
- 3. Make your changes
397
- 4. Add tests if applicable
398
- 5. Submit a pull request
399
-
400
- ### Development Guidelines
401
-
402
- - Follow existing code style (ESLint configured)
403
- - Add TypeScript types for new features
404
- - Update documentation for new parameters
405
- - Test with various video formats
406
-
407
- ## Roadmap
408
-
409
- ### v1.1 (Planned)
410
-
411
- - [ ] Multiple video layers
412
- - [ ] Video transitions
413
- - [ ] Logo/watermark overlay
414
- - [ ] Preset subtitle templates
415
- - [ ] Batch processing mode
416
-
417
- ### v2.0 (Future)
418
-
419
- - [ ] GPU acceleration (NVENC, VideoToolbox)
420
- - [ ] Cloud storage integration
421
- - [ ] Progress callbacks
422
- - [ ] Advanced video effects
423
-
424
- ## Credits
425
-
426
- - Inspired by [n8n-nodes-mediafx](https://github.com/dandacompany/n8n-nodes-mediafx)
427
- - Uses [FFmpeg](https://ffmpeg.org/) for video processing
428
- - Built with [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg)
429
-
430
- ## License
431
-
432
- [MIT](LICENSE)
433
-
434
- ## Support
435
-
436
- - **Issues**: [GitHub Issues](https://github.com/choisb87/sb-render/issues)
437
- - **Documentation**: [GitHub Wiki](https://github.com/choisb87/sb-render/wiki)
438
- - **n8n Community**: [n8n Community Forum](https://community.n8n.io/)
439
-
440
- ---
441
-
442
- **Made with ❤️ for the n8n community**
1
+ # n8n-nodes-sb-render
2
+
3
+ [![npm version](https://badge.fury.io/js/n8n-nodes-sb-render.svg)](https://badge.fury.io/js/n8n-nodes-sb-render)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ This is an n8n community node for video rendering with customizable subtitles, background music (BGM), and narration using FFmpeg.
7
+
8
+ **sb-render** allows you to automate video composition workflows in n8n, combining video files with:
9
+ - 🎵 Background music with volume control and fade effects
10
+ - 🎙️ Narration audio with timing control
11
+ - 📝 Customizable subtitles with extensive styling options
12
+ - 🎨 Multiple output formats and quality presets
13
+
14
+ Inspired by [n8n-nodes-mediafx](https://github.com/dandacompany/n8n-nodes-mediafx).
15
+
16
+ ## Table of Contents
17
+
18
+ - [Installation](#installation)
19
+ - [Prerequisites](#prerequisites)
20
+ - [Operations](#operations)
21
+ - [Configuration](#configuration)
22
+ - [Examples](#examples)
23
+ - [Development](#development)
24
+ - [Troubleshooting](#troubleshooting)
25
+ - [License](#license)
26
+
27
+ ## Installation
28
+
29
+ ### Community Nodes (Recommended)
30
+
31
+ 1. Go to **Settings > Community Nodes** in n8n
32
+ 2. Select **Install**
33
+ 3. Enter `n8n-nodes-sb-render`
34
+ 4. Agree to the risks and install
35
+
36
+ ### Manual Installation
37
+
38
+ ```bash
39
+ npm install n8n-nodes-sb-render
40
+ ```
41
+
42
+ For n8n self-hosted installations:
43
+
44
+ ```bash
45
+ cd ~/.n8n
46
+ npm install n8n-nodes-sb-render
47
+ # Restart n8n
48
+ ```
49
+
50
+ ## Prerequisites
51
+
52
+ - **n8n version**: 1.0.0 or higher
53
+ - **Node.js**: 16.0.0 or higher
54
+ - **FFmpeg**: Automatically installed via `@ffmpeg-installer/ffmpeg`
55
+
56
+ ## Operations
57
+
58
+ ### Video → Render
59
+
60
+ Compose a video with optional background music, narration, and subtitles.
61
+
62
+ **Features:**
63
+ - ✅ Multiple input sources (URL or binary data)
64
+ - ✅ Audio mixing with independent volume controls
65
+ - ✅ Fade in/out effects for BGM
66
+ - ✅ Customizable subtitle positioning and styling
67
+ - ✅ Multiple output formats (MP4, MOV, WebM)
68
+ - ✅ Quality presets (Low, Medium, High, Custom)
69
+
70
+ ## Configuration
71
+
72
+ ### Video Input
73
+
74
+ | Parameter | Type | Required | Description |
75
+ |-----------|------|----------|-------------|
76
+ | **Video Source** | Options | Yes | `url` or `binary` |
77
+ | **Video URL** | String | If URL | URL of the video file |
78
+ | **Video Binary Property** | String | If Binary | Name of binary property containing video |
79
+
80
+ ### Background Music (BGM)
81
+
82
+ | Parameter | Type | Default | Description |
83
+ |-----------|------|---------|-------------|
84
+ | **Enable BGM** | Boolean | false | Add background music |
85
+ | **BGM Source** | Options | - | `url` or `binary` |
86
+ | **BGM URL** | String | - | URL of BGM file |
87
+ | **BGM Volume** | Number | 30 | Volume 0-100 |
88
+ | **BGM Fade In** | Number | 2 | Fade-in duration (seconds) |
89
+ | **BGM Fade Out** | Number | 2 | Fade-out duration (seconds) |
90
+
91
+ ### Narration
92
+
93
+ | Parameter | Type | Default | Description |
94
+ |-----------|------|---------|-------------|
95
+ | **Enable Narration** | Boolean | false | Add narration audio |
96
+ | **Narration Source** | Options | - | `url` or `binary` |
97
+ | **Narration URL** | String | - | URL of narration file |
98
+ | **Narration Volume** | Number | 80 | Volume 0-100 |
99
+ | **Narration Delay** | Number | 0 | Delay before start (seconds) |
100
+
101
+ ### Subtitles
102
+
103
+ | Parameter | Type | Default | Description |
104
+ |-----------|------|---------|-------------|
105
+ | **Enable Subtitles** | Boolean | false | Add subtitles |
106
+ | **Text** | String | - | Subtitle text content |
107
+ | **Start Time** | Number | - | Start time in seconds |
108
+ | **End Time** | Number | - | End time in seconds |
109
+ | **Position** | Options | bottom | `top`, `middle`, `bottom`, `custom` |
110
+ | **Font Size** | Number | 48 | Text size |
111
+ | **Font Color** | Color | #FFFFFF | Text color (hex) |
112
+ | **Font Family** | String | Arial | Font name |
113
+ | **Alignment** | Options | center | `left`, `center`, `right` |
114
+ | **Background Color** | Color | #000000 | Background color (hex) |
115
+ | **Background Opacity** | Number | 80 | Opacity 0-100 |
116
+ | **Border Color** | Color | #000000 | Border color (hex) |
117
+ | **Border Width** | Number | 2 | Border width (pixels) |
118
+
119
+ ### Output Options
120
+
121
+ | Parameter | Type | Default | Description |
122
+ |-----------|------|---------|-------------|
123
+ | **Output Format** | Options | mp4 | `mp4`, `mov`, `webm` |
124
+ | **Video Codec** | Options | libx264 | `libx264`, `libx265`, `vp9` |
125
+ | **Quality** | Options | high | `low`, `medium`, `high`, `custom` |
126
+ | **Custom CRF** | Number | 18 | CRF value 0-51 (if custom quality) |
127
+ | **Output Binary Property** | String | data | Property name for output |
128
+
129
+ ## Examples
130
+
131
+ ### Example 1: Simple Video with Subtitles
132
+
133
+ ```json
134
+ {
135
+ "videoSource": "url",
136
+ "videoUrl": "https://example.com/video.mp4",
137
+ "enableSubtitles": true,
138
+ "subtitles": {
139
+ "subtitle": [
140
+ {
141
+ "text": "Welcome to our video!",
142
+ "startTime": 0,
143
+ "endTime": 5,
144
+ "position": "bottom",
145
+ "fontSize": 48,
146
+ "fontColor": "#FFFFFF",
147
+ "alignment": "center"
148
+ }
149
+ ]
150
+ },
151
+ "outputFormat": "mp4",
152
+ "quality": "high"
153
+ }
154
+ ```
155
+
156
+ ### Example 2: Video with BGM and Narration
157
+
158
+ ```json
159
+ {
160
+ "videoSource": "url",
161
+ "videoUrl": "https://example.com/video.mp4",
162
+ "enableBGM": true,
163
+ "bgmSource": "url",
164
+ "bgmUrl": "https://example.com/music.mp3",
165
+ "bgmVolume": 20,
166
+ "bgmFadeIn": 3,
167
+ "bgmFadeOut": 3,
168
+ "enableNarration": true,
169
+ "narrationSource": "url",
170
+ "narrationUrl": "https://example.com/narration.mp3",
171
+ "narrationVolume": 90,
172
+ "narrationDelay": 2,
173
+ "outputFormat": "mp4"
174
+ }
175
+ ```
176
+
177
+ ### Example 3: Custom Positioned Subtitles
178
+
179
+ ```json
180
+ {
181
+ "videoSource": "url",
182
+ "videoUrl": "https://example.com/video.mp4",
183
+ "enableSubtitles": true,
184
+ "subtitles": {
185
+ "subtitle": [
186
+ {
187
+ "text": "Top-left subtitle",
188
+ "startTime": 0,
189
+ "endTime": 5,
190
+ "position": "custom",
191
+ "customX": 100,
192
+ "customY": 100,
193
+ "fontSize": 36,
194
+ "fontColor": "#FFFF00",
195
+ "alignment": "left",
196
+ "backgroundColor": "#000000",
197
+ "backgroundOpacity": 70,
198
+ "borderColor": "#FFFFFF",
199
+ "borderWidth": 3
200
+ }
201
+ ]
202
+ }
203
+ }
204
+ ```
205
+
206
+ ### Example 4: Workflow Integration
207
+
208
+ **Scenario**: Download video from URL, add BGM and subtitles, upload to cloud storage
209
+
210
+ ```
211
+ HTTP Request → SB Render → Google Drive
212
+ ```
213
+
214
+ 1. **HTTP Request**: Download video file
215
+ 2. **SB Render**: Add BGM and subtitles
216
+ 3. **Google Drive**: Upload rendered video
217
+
218
+ ## Development
219
+
220
+ ### Build
221
+
222
+ ```bash
223
+ npm install
224
+ npm run build
225
+ ```
226
+
227
+ ### Development Mode
228
+
229
+ ```bash
230
+ npm run dev
231
+ ```
232
+
233
+ ### Linting
234
+
235
+ ```bash
236
+ npm run lint
237
+ npm run lintfix
238
+ ```
239
+
240
+ ### Project Structure
241
+
242
+ ```
243
+ sb-render/
244
+ ├── nodes/
245
+ │ └── SbRender/
246
+ │ ├── SbRender.node.ts # Main node implementation
247
+ │ ├── SbRender.node.json # Node metadata
248
+ │ ├── services/
249
+ │ │ ├── FileManager.ts # File handling
250
+ │ │ ├── AudioMixer.ts # Audio composition
251
+ │ │ ├── SubtitleEngine.ts # Subtitle generation
252
+ │ │ └── VideoComposer.ts # Video rendering
253
+ │ ├── interfaces/
254
+ │ │ └── index.ts # TypeScript types
255
+ │ └── utils/
256
+ │ ├── ffmpeg.ts # FFmpeg helpers
257
+ │ └── validation.ts # Input validation
258
+ ├── fonts/ # Custom fonts
259
+ ├── package.json
260
+ ├── tsconfig.json
261
+ └── README.md
262
+ ```
263
+
264
+ ## Troubleshooting
265
+
266
+ ### FFmpeg Not Found
267
+
268
+ The node automatically installs FFmpeg via `@ffmpeg-installer/ffmpeg`. If you encounter issues:
269
+
270
+ ```bash
271
+ npm install @ffmpeg-installer/ffmpeg --force
272
+ ```
273
+
274
+ ### File Download Errors
275
+
276
+ **Issue**: Video/audio URLs fail to download
277
+
278
+ **Solutions**:
279
+ - Verify URL accessibility
280
+ - Check for authentication requirements
281
+ - Ensure sufficient disk space
282
+ - Try using binary data input instead
283
+
284
+ ### Subtitle Not Appearing
285
+
286
+ **Issue**: Subtitles don't show in output video
287
+
288
+ **Solutions**:
289
+ - Verify timing (start/end times within video duration)
290
+ - Check subtitle position and size
291
+ - Ensure font is available on system
292
+ - Try different output format (MP4 recommended)
293
+
294
+ ### Memory Issues
295
+
296
+ **Issue**: Process crashes with large video files
297
+
298
+ **Solutions**:
299
+ - Reduce video resolution before processing
300
+ - Use lower quality preset
301
+ - Process videos in smaller batches
302
+ - Increase Node.js memory limit:
303
+
304
+ ```bash
305
+ export NODE_OPTIONS="--max-old-space-size=4096"
306
+ ```
307
+
308
+ ### Audio Sync Issues
309
+
310
+ **Issue**: Audio out of sync with video
311
+
312
+ **Solutions**:
313
+ - Ensure all audio files are in compatible formats
314
+ - Check narration delay settings
315
+ - Verify video frame rate compatibility
316
+ - Try re-encoding source files
317
+
318
+ ## Technical Details
319
+
320
+ ### FFmpeg Commands
321
+
322
+ The node uses **fluent-ffmpeg** to construct FFmpeg commands:
323
+
324
+ **Audio Mixing**:
325
+ ```bash
326
+ -filter_complex "[0:a]volume=1.0[original];[1:a]volume=0.3,afade=t=in:st=0:d=2[bgm];[original][bgm]amix=inputs=2[mixed]"
327
+ ```
328
+
329
+ **Subtitle Overlay**:
330
+ ```bash
331
+ -vf "ass=subtitles.ass"
332
+ ```
333
+
334
+ **Complete Command**:
335
+ ```bash
336
+ ffmpeg -i video.mp4 -i bgm.mp3 -filter_complex "..." -vf "ass=..." -c:v libx264 -crf 18 output.mp4
337
+ ```
338
+
339
+ ### Subtitle Formats
340
+
341
+ - **SRT**: Simple subtitle format (limited styling)
342
+ - **ASS**: Advanced SubStation Alpha (full styling support) ← **Used by default**
343
+
344
+ ASS format provides:
345
+ - Custom fonts and colors
346
+ - Precise positioning
347
+ - Background colors and opacity
348
+ - Border/outline effects
349
+ - Multiple alignment options
350
+
351
+ ## Performance
352
+
353
+ ### Resource Usage
354
+
355
+ | Video Length | Memory | Processing Time |
356
+ |--------------|--------|-----------------|
357
+ | 1 minute | ~200MB | ~30 seconds |
358
+ | 5 minutes | ~500MB | ~2 minutes |
359
+ | 10 minutes | ~1GB | ~5 minutes |
360
+
361
+ *Times measured on standard VPS (2 CPU, 4GB RAM)*
362
+
363
+ ### Optimization Tips
364
+
365
+ 1. **Use appropriate quality**: High quality for final output, medium for testing
366
+ 2. **Compress BGM**: Use lower bitrate audio files (128-192 kbps)
367
+ 3. **Batch processing**: Process multiple videos in parallel workflows
368
+ 4. **Cache audio files**: Reuse same BGM/narration across multiple videos
369
+
370
+ ## Compatibility
371
+
372
+ ### Supported Video Formats
373
+
374
+ **Input**: MP4, MOV, WebM, AVI, MKV
375
+ **Output**: MP4, MOV, WebM
376
+
377
+ ### Supported Audio Formats
378
+
379
+ **Input**: MP3, WAV, AAC, OGG, M4A
380
+ **Output**: AAC (default)
381
+
382
+ ### Codec Compatibility
383
+
384
+ | Codec | Quality | Speed | Browser Support |
385
+ |-------|---------|-------|-----------------|
386
+ | H.264 (libx264) | Good | Fast | Excellent |
387
+ | H.265 (libx265) | Better | Slower | Limited |
388
+ | VP9 | Good | Slow | Good (WebM) |
389
+
390
+ ## Contributing
391
+
392
+ Contributions are welcome! Please:
393
+
394
+ 1. Fork the repository
395
+ 2. Create a feature branch
396
+ 3. Make your changes
397
+ 4. Add tests if applicable
398
+ 5. Submit a pull request
399
+
400
+ ### Development Guidelines
401
+
402
+ - Follow existing code style (ESLint configured)
403
+ - Add TypeScript types for new features
404
+ - Update documentation for new parameters
405
+ - Test with various video formats
406
+
407
+ ## Roadmap
408
+
409
+ ### v1.1 (Planned)
410
+
411
+ - [ ] Multiple video layers
412
+ - [ ] Video transitions
413
+ - [ ] Logo/watermark overlay
414
+ - [ ] Preset subtitle templates
415
+ - [ ] Batch processing mode
416
+
417
+ ### v2.0 (Future)
418
+
419
+ - [ ] GPU acceleration (NVENC, VideoToolbox)
420
+ - [ ] Cloud storage integration
421
+ - [ ] Progress callbacks
422
+ - [ ] Advanced video effects
423
+
424
+ ## Credits
425
+
426
+ - Inspired by [n8n-nodes-mediafx](https://github.com/dandacompany/n8n-nodes-mediafx)
427
+ - Uses [FFmpeg](https://ffmpeg.org/) for video processing
428
+ - Built with [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg)
429
+
430
+ ## License
431
+
432
+ [MIT](LICENSE)
433
+
434
+ ## Support
435
+
436
+ - **Issues**: [GitHub Issues](https://github.com/choisb87/sb-render/issues)
437
+ - **Documentation**: [GitHub Wiki](https://github.com/choisb87/sb-render/wiki)
438
+ - **n8n Community**: [n8n Community Forum](https://community.n8n.io/)
439
+
440
+ ---
441
+
442
+ **Made with ❤️ for the n8n community**