mulmocast 2.1.2 → 2.1.3
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/lib/actions/movie.js +10 -9
- package/package.json +1 -1
package/lib/actions/movie.js
CHANGED
|
@@ -144,7 +144,11 @@ const addTransitionEffects = (ffmpegContext, captionedVideoId, context, transiti
|
|
|
144
144
|
}
|
|
145
145
|
// Transition happens at the start of this beat
|
|
146
146
|
const startAt = beatTimestamps[beatIndex] - 0.05; // 0.05 is to avoid flickering
|
|
147
|
-
|
|
147
|
+
// Limit transition duration to be no longer than either beat's duration
|
|
148
|
+
const prevBeatDuration = context.studio.beats[beatIndex - 1].duration ?? 1;
|
|
149
|
+
const currentBeatDuration = context.studio.beats[beatIndex].duration ?? 1;
|
|
150
|
+
const maxDuration = Math.min(prevBeatDuration, currentBeatDuration) * 0.9; // Use 90% to leave some margin
|
|
151
|
+
const duration = Math.min(transition.duration, maxDuration);
|
|
148
152
|
const outputVideoId = `trans_${beatIndex}_o`;
|
|
149
153
|
const processedVideoId = `${transitionVideoId}_f`;
|
|
150
154
|
if (transition.type === "fade") {
|
|
@@ -185,14 +189,11 @@ const addTransitionEffects = (ffmpegContext, captionedVideoId, context, transiti
|
|
|
185
189
|
// Cannot apply wipe without first frame
|
|
186
190
|
return prevVideoId;
|
|
187
191
|
}
|
|
188
|
-
//
|
|
189
|
-
//
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
// Start the transition at the end of the first video minus the transition duration
|
|
194
|
-
const xfadeOffset = Math.max(0, prevBeatActualDuration - duration);
|
|
195
|
-
// Apply xfade with explicit pixel format
|
|
192
|
+
// For wipe transitions, use offset=0 so transition starts immediately and completes within duration
|
|
193
|
+
// This ensures 0-100% wipe happens exactly during the transition duration
|
|
194
|
+
const xfadeOffset = 0;
|
|
195
|
+
// Apply xfade with offset=0 for complete 0-100% transition
|
|
196
|
+
// Both input videos should be at least duration seconds long (ensured by static frame generation)
|
|
196
197
|
const xfadeOutputId = `${transitionVideoId}_xfade`;
|
|
197
198
|
ffmpegContext.filterComplex.push(`[${transitionVideoId}]format=yuv420p[${transitionVideoId}_fmt]`);
|
|
198
199
|
ffmpegContext.filterComplex.push(`[${nextVideoId}]format=yuv420p[${nextVideoId}_fmt]`);
|