From e81f12f89aa7b8e35abeb8ee359cc4461803a455 Mon Sep 17 00:00:00 2001 From: Towsty Date: Tue, 25 Aug 2026 23:06:58 -0500 Subject: [PATCH] Add clip extension from the last frame with FFmpeg stitching. Let a finished player continue into a new MiniMax segment, then losslessly concat the parts and discard the intermediate files so the library keeps one extended MP4. Co-authored-by: Cursor --- pages/index.vue | 193 ++++++++++++++- server/api/extend.post.ts | 233 ++++++++++++++++++ server/api/generate.post.ts | 4 +- server/api/interrupt.post.ts | 1 + .../api/library/clips/[id]/last-frame.get.ts | 25 ++ server/utils/ffmpeg.ts | 156 ++++++++++++ server/utils/jobs.ts | 3 + server/utils/library.ts | 15 ++ server/utils/pending.ts | 25 +- server/utils/watch.ts | 29 ++- 10 files changed, 666 insertions(+), 18 deletions(-) create mode 100644 server/api/extend.post.ts create mode 100644 server/api/library/clips/[id]/last-frame.get.ts create mode 100644 server/utils/ffmpeg.ts diff --git a/pages/index.vue b/pages/index.vue index 1cfa1e4..ae58d7f 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -331,18 +331,84 @@ Saved to a locked folder Unlock that folder in the library to view this clip -
- Generated MP4 appears here -
- - - Download MP4 - + Generated MP4 appears here + + +
+ + Download MP4 + + +
+
+
+
+

Extend this clip

+

Continue from the last frame with a new motion prompt, then stitch the segments together.

+
+ +
+
+ Last frame +

+ {{ lastFrameLoading ? 'Reading last frame…' : 'Last frame preview unavailable' }} +

+
+