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 <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-25 23:06:58 -05:00
co-authored by Cursor
parent dbe45fd2ff
commit e81f12f89a
10 changed files with 666 additions and 18 deletions
+15
View File
@@ -462,6 +462,21 @@ export function clipVideoPath(owner: string, id: string) {
return join(clipDir(owner, id), 'video.mp4')
}
export function clipLastFramePath(owner: string, id: string) {
return join(clipDir(owner, id), 'last-frame.png')
}
export function extendTempDir(owner: string, jobId: string) {
const dir = join(ownerRoot(owner), 'tmp', 'extend', jobId)
mkdirSync(dir, { recursive: true })
return dir
}
export function removeExtendTemp(dir?: string) {
if (!dir) return
rmSync(dir, { recursive: true, force: true })
}
export function clipThumbPath(owner: string, id: string) {
const dir = clipDir(owner, id)
for (const name of ['thumb.jpg', 'thumb.png', 'thumb']) {