@lee-jisoo/n8n-nodes-mediafx 1.6.8 → 1.6.9

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.
@@ -97,20 +97,20 @@ function isASSFile(filePath) {
97
97
  * Convert SRT content to ASS format with full styling support
98
98
  */
99
99
  function convertSRTtoASS(srtContent, fontName, fontSize, primaryColor, outlineColor, outlineWidth, backColor, enableBackground, alignment, marginV, marginL, marginR, videoWidth, videoHeight) {
100
- // BorderStyle=3 with large Outline creates a background box effect
101
- // OutlineColour is used as the box color when BorderStyle=3
100
+ // BorderStyle=3 enables opaque box mode where BackColour determines the box color
101
+ // BorderStyle=1 is normal outline mode
102
102
  let borderStyle;
103
103
  let outline;
104
104
  let shadow;
105
105
  let effectiveOutlineColor;
106
106
  if (enableBackground) {
107
- borderStyle = 3;
108
- outline = 15; // Large outline creates box effect
107
+ borderStyle = 3; // Opaque box mode - BackColour becomes the box background
108
+ outline = 0; // No outline needed in box mode
109
109
  shadow = 0;
110
- effectiveOutlineColor = backColor; // Use background color as outline
110
+ effectiveOutlineColor = backColor; // Match outline to background for clean look
111
111
  }
112
112
  else {
113
- borderStyle = 1;
113
+ borderStyle = 1; // Normal outline mode
114
114
  outline = outlineWidth;
115
115
  shadow = 0;
116
116
  effectiveOutlineColor = outlineColor;
@@ -227,10 +227,15 @@ async function executeAddSubtitle(video, subtitleFile, style, itemIndex) {
227
227
  tempAssFile = path.join(os.tmpdir(), `mediafx_sub_${Date.now()}_${Math.random().toString(36).substring(7)}.ass`);
228
228
  await fs.writeFile(tempAssFile, assContent, 'utf-8');
229
229
  finalSubtitlePath = tempAssFile;
230
+ // Debug: log ASS content for troubleshooting
231
+ console.log('[MediaFX] Generated ASS file:', tempAssFile);
232
+ console.log('[MediaFX] ASS Style line:', assContent.split('\n').find(line => line.startsWith('Style:')));
230
233
  }
231
- // 5. Build FFmpeg command
234
+ // 5. Build FFmpeg command with fontsdir for custom fonts
232
235
  const escapedPath = escapeSubtitlePath(finalSubtitlePath);
233
- const subtitlesFilter = `ass='${escapedPath}'`;
236
+ const fontPath = font.path;
237
+ const fontDir = escapeSubtitlePath(path.dirname(fontPath));
238
+ const subtitlesFilter = `ass='${escapedPath}':fontsdir='${fontDir}'`;
234
239
  const command = ffmpeg(video)
235
240
  .videoFilters([subtitlesFilter])
236
241
  .audioCodec('copy')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lee-jisoo/n8n-nodes-mediafx",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
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": {