@lee-jisoo/n8n-nodes-mediafx 1.6.12 → 1.6.14

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,24 @@ 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.14
14
+ **Subtitle Enhancements (v1.6.1 ~ v1.6.14)**
15
+
16
+ - **🎨 Background Box Padding**: Fixed text sticking to background box edges
17
+ - Added horizontal padding (`\h` hard spaces) when background is enabled
18
+ - Padding automatically scales with font size
19
+
20
+ - **🎯 Full ASS Format Support**: Complete subtitle styling overhaul
21
+ - SRT to ASS auto-conversion for advanced styling
22
+ - Dynamic video resolution detection (supports vertical videos like 1080x1920)
23
+ - Proper `BorderStyle=3` implementation for opaque background boxes
24
+ - Fixed background color transparency with correct `Outline=0, Shadow=1` settings
25
+
26
+ - **📍 Flexible Positioning**:
27
+ - 9-point alignment grid (top/middle/bottom × left/center/right)
28
+ - Customizable padding (X/Y margins)
29
+ - Outline width and color options
30
+
13
31
  ### v1.6.0
14
32
  - **🎬 Speed Operation**: Adjust video playback speed (slow motion or fast forward)
15
33
  - Speed range: 0.25x to 4x
@@ -93,6 +93,21 @@ function isASSFile(filePath) {
93
93
  const ext = path.extname(filePath).toLowerCase();
94
94
  return ext === '.ass' || ext === '.ssa';
95
95
  }
96
+ /**
97
+ * Add horizontal padding to subtitle text for background box mode.
98
+ * ASS doesn't support native padding, so we use transparent spaces with \h (hard space).
99
+ * The padding is achieved by adding non-breaking spaces before and after the text.
100
+ */
101
+ function addTextPadding(text, paddingSpaces) {
102
+ if (paddingSpaces <= 0)
103
+ return text;
104
+ // \h is ASS hard space (non-breaking space that takes up visual space)
105
+ const padding = '\\h'.repeat(paddingSpaces);
106
+ // Handle multi-line subtitles (separated by \N)
107
+ const lines = text.split('\\N');
108
+ const paddedLines = lines.map(line => `${padding}${line}${padding}`);
109
+ return paddedLines.join('\\N');
110
+ }
96
111
  /**
97
112
  * Convert SRT content to ASS format with full styling support
98
113
  */
@@ -134,6 +149,9 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
134
149
  // Parse SRT blocks
135
150
  const blocks = srtContent.trim().split(/\r?\n\r?\n/);
136
151
  const dialogues = [];
152
+ // Calculate padding spaces based on font size (approximately 0.5em worth of padding)
153
+ // Smaller fonts need fewer spaces, larger fonts need more
154
+ const paddingSpaces = enableBackground ? Math.max(2, Math.round(fontSize / 24)) : 0;
137
155
  for (const block of blocks) {
138
156
  const lines = block.trim().split(/\r?\n/);
139
157
  if (lines.length < 2)
@@ -158,7 +176,11 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
158
176
  const startTime = `${parseInt(match[1])}:${match[2]}:${match[3]}.${match[4].substring(0, 2)}`;
159
177
  const endTime = `${parseInt(match[5])}:${match[6]}:${match[7]}.${match[8].substring(0, 2)}`;
160
178
  // Get subtitle text (remaining lines)
161
- const text = lines.slice(textStartIndex).join('\\N');
179
+ let text = lines.slice(textStartIndex).join('\\N');
180
+ // Add horizontal padding when background is enabled
181
+ if (enableBackground && text.trim()) {
182
+ text = addTextPadding(text, paddingSpaces);
183
+ }
162
184
  if (text.trim()) {
163
185
  dialogues.push(`Dialogue: 0,${startTime},${endTime},Default,,0,0,0,,${text}`);
164
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lee-jisoo/n8n-nodes-mediafx",
3
- "version": "1.6.12",
3
+ "version": "1.6.14",
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": {