Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

perf: shrink creator preset preview videos

卡皮巴拉172d2bce42f4
diff --git a/apps/daemon/src/creator/presets/compiler.ts b/apps/daemon/src/creator/presets/compiler.ts
index 08df03ef..0ab9a871 100644
--- a/apps/daemon/src/creator/presets/compiler.ts
+++ b/apps/daemon/src/creator/presets/compiler.ts
@@ -39,7 +39,9 @@ const MIME_BY_EXTENSION = new Map([
const MAX_COVER_SIZE = 2 * 1024 * 1024;
const MAX_PREVIEW_SIZE = 4 * 1024 * 1024;
const MAX_AUTHOR_AVATAR_SIZE = 512 * 1024;
-const MAX_PREVIEW_VIDEO_SIZE = 48 * 1024 * 1024;
+const MAX_PREVIEW_VIDEO_SIZE = 8 * 1024 * 1024;
+const MAX_PREVIEW_VIDEO_DURATION_SECONDS = 10;
+const MAX_PREVIEW_VIDEO_TOTAL_SIZE = 20 * 1024 * 1024;
export async function validateCreatorPresets(
options: CreatorPresetCompilerOptions
@@ -50,6 +52,7 @@ export async function validateCreatorPresets(
const entries = await findTemplateManifests(sourceRoot);
const presets: CompiledCreatorPreset[] = [];
const identities = new Set<string>();
+ let previewVideoTotalSize = 0;
for (const entry of entries) {
const manifest = await readSourceManifest(entry.file, entry.relativeFile);
@@ -86,6 +89,15 @@ export async function validateCreatorPresets(
manifest.previewVideo,
entry.relativeFile
);
+ if (previewVideo !== undefined) {
+ previewVideoTotalSize += previewVideo.size;
+ if (previewVideoTotalSize > MAX_PREVIEW_VIDEO_TOTAL_SIZE) {
+ throw new Error(
+ `${entry.relativeFile}.previewVideo: total preview video size exceeds `
+ + `${MAX_PREVIEW_VIDEO_TOTAL_SIZE / 1024 / 1024} MiB`
+ );
+ }
+ }
const authorAvatar = manifest.author?.avatar === undefined
? undefined
: await validateAuthorAvatar(
@@ -465,6 +477,12 @@ async function validatePreviewVideo(
if (bytes.length < 12 || bytes.subarray(4, 8).toString('ascii') !== 'ftyp') {
throw new Error(`${relativeFile}.previewVideo: video contents do not match MP4`);
}
+ const duration = readMp4Duration(bytes);
+ if (duration !== undefined && duration > MAX_PREVIEW_VIDEO_DURATION_SECONDS) {
+ throw new Error(
+ `${relativeFile}.previewVideo: duration exceeds ${MAX_PREVIEW_VIDEO_DURATION_SECONDS} seconds`
+ );
+ }
return {
...resource,
extension: '.mp4',
@@ -473,6 +491,66 @@ async function validatePreviewVideo(
};
}
+type Mp4Box = {
+ dataStart: number;
+ end: number;
+};
+
+// Keep preview validation self-contained so builds do not depend on ffprobe.
+function readMp4Duration(bytes: Buffer): number | undefined {
+ const moov = findMp4Box(bytes, 0, bytes.length, 'moov');
+ if (moov === undefined) return undefined;
+ const mvhd = findMp4Box(bytes, moov.dataStart, moov.end, 'mvhd');
+ if (mvhd === undefined || mvhd.dataStart >= mvhd.end) return undefined;
+
+ const version = bytes[mvhd.dataStart];
+ if (version === 0) {
+ if (mvhd.dataStart + 20 > mvhd.end) return undefined;
+ const timescale = bytes.readUInt32BE(mvhd.dataStart + 12);
+ const duration = bytes.readUInt32BE(mvhd.dataStart + 16);
+ return timescale === 0 ? undefined : duration / timescale;
+ }
+ if (version === 1) {
+ if (mvhd.dataStart + 32 > mvhd.end) return undefined;
+ const timescale = bytes.readUInt32BE(mvhd.dataStart + 20);
+ const duration = bytes.readBigUInt64BE(mvhd.dataStart + 24);
+ return timescale === 0 ? undefined : Number(duration) / timescale;
+ }
+ return undefined;
+}
+
+function findMp4Box(
+ bytes: Buffer,
+ start: number,
+ end: number,
+ type: string
+): Mp4Box | undefined {
+ let offset = start;
+ while (offset + 8 <= end) {
+ const size32 = bytes.readUInt32BE(offset);
+ const boxType = bytes.toString('ascii', offset + 4, offset + 8);
+ let headerSize = 8;
+ let boxSize: number;
+ if (size32 === 1) {
+ if (offset + 16 > end) return undefined;
+ const extendedSize = bytes.readBigUInt64BE(offset + 8);
+ if (extendedSize > BigInt(Number.MAX_SAFE_INTEGER)) return undefined;
+ boxSize = Number(extendedSize);
+ headerSize = 16;
+ } else if (size32 === 0) {
+ boxSize = end - offset;
+ } else {
+ boxSize = size32;
+ }
+ if (boxSize < headerSize || offset + boxSize > end) return undefined;
+ if (boxType === type) {
+ return { dataStart: offset + headerSize, end: offset + boxSize };
+ }
+ offset += boxSize;
+ }
+ return undefined;
+}
+
type ValidatedImageResource = {
file: string;
extension: '.png' | '.jpg' | '.jpeg' | '.webp';
diff --git a/apps/daemon/test/unit/creator-preset-compiler.test.ts b/apps/daemon/test/unit/creator-preset-compiler.test.ts
index f806281b..143ccc3d 100644
--- a/apps/daemon/test/unit/creator-preset-compiler.test.ts
+++ b/apps/daemon/test/unit/creator-preset-compiler.test.ts
@@ -207,6 +207,51 @@ describe('creator preset compiler', () => {
);
});
+ it('rejects oversized, overlong, and aggregate preview videos', async () => {
+ const fixture = setup();
+ const preset = copyOfficialPreset({
+ sourceRoot: fixture.sourceRoot,
+ module: 'video-generation',
+ sourceId: 'aerial-pullback-rise-reveal'
+ });
+
+ const oversized = Buffer.alloc(8 * 1024 * 1024 + 1);
+ oversized.writeUInt32BE(12, 0);
+ oversized.write('ftyp', 4, 'ascii');
+ writeFileSync(join(preset, 'example.mp4'), oversized);
+ await expect(validateCreatorPresets(fixture)).rejects.toThrow(
+ 'previewVideo exceeds 8 MiB'
+ );
+
+ const overlong = createMinimalMp4(11);
+ writeFileSync(join(preset, 'example.mp4'), overlong);
+ await expect(validateCreatorPresets(fixture)).rejects.toThrow(
+ 'previewVideo: duration exceeds 10 seconds'
+ );
+
+ const second = copyOfficialPreset({
+ sourceRoot: fixture.sourceRoot,
+ module: 'video-generation',
+ sourceId: 'dolly-zoom-space-warp',
+ id: 'dolly-zoom-space-warp-2'
+ });
+ const third = copyOfficialPreset({
+ sourceRoot: fixture.sourceRoot,
+ module: 'video-generation',
+ sourceId: 'drone-orbit-subject',
+ id: 'drone-orbit-subject-2'
+ });
+ const largePreview = Buffer.alloc(7 * 1024 * 1024);
+ largePreview.writeUInt32BE(12, 0);
+ largePreview.write('ftyp', 4, 'ascii');
+ writeFileSync(join(preset, 'example.mp4'), largePreview);
+ writeFileSync(join(second, 'example.mp4'), largePreview);
+ writeFileSync(join(third, 'example.mp4'), largePreview);
+ await expect(validateCreatorPresets(fixture)).rejects.toThrow(
+ 'total preview video size exceeds 20 MiB'
+ );
+ });
+
it('compiles the English video translation locale with Runtime language ids', async () => {
const fixture = setup();
copyOfficialPreset({
@@ -278,3 +323,24 @@ describe('creator preset compiler', () => {
expect(hashDirectory(fixture.outputRoot)).toBe(before);
});
});
+
+function createMinimalMp4(durationSeconds: number): Buffer {
+ const ftyp = Buffer.alloc(12);
+ ftyp.writeUInt32BE(12, 0);
+ ftyp.write('ftyp', 4, 'ascii');
+ ftyp.write('isom', 8, 'ascii');
+
+ const mvhdData = Buffer.alloc(20);
+ mvhdData.writeUInt32BE(1000, 12);
+ mvhdData.writeUInt32BE(durationSeconds * 1000, 16);
+ const mvhd = Buffer.alloc(8 + mvhdData.length);
+ mvhd.writeUInt32BE(mvhd.length, 0);
+ mvhd.write('mvhd', 4, 'ascii');
+ mvhdData.copy(mvhd, 8);
+
+ const moov = Buffer.alloc(8 + mvhd.length);
+ moov.writeUInt32BE(moov.length, 0);
+ moov.write('moov', 4, 'ascii');
+ mvhd.copy(moov, 8);
+ return Buffer.concat([ftyp, moov]);
+}
diff --git a/assets/creator-preset-video-sources/README.md b/assets/creator-preset-video-sources/README.md
new file mode 100644
index 00000000..4a25b47b
--- /dev/null
+++ b/assets/creator-preset-video-sources/README.md
@@ -0,0 +1,9 @@
+# Creator Preset Video Sources
+
+本目录保存 Creator 模板预览视频的原始 MP4,仅用于重新生成模板目录中的轻量预览片。
+
+- `video-generation/<template-id>/1/example.mp4` 是原始样片。
+- `template/video-generation/<template-id>/1/example.mp4` 是安装包实际使用的预览片。
+- 原始样片不参与 `templates:compile`,也不会进入 Web 或 Desktop 资源包。
+- 预览片由 `node scripts/optimize-creator-preview-videos.mjs` 生成,默认限制为 8 秒、最长边 640 像素、15 fps、H.264 CRF 29。
+- 编译器同时限制单个预览片不超过 8 MiB、时长不超过 10 秒,全部模板预览片合计不超过 20 MiB。
diff --git a/assets/creator-preset-video-sources/video-generation/aerial-pullback-rise-reveal/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/aerial-pullback-rise-reveal/1/example.mp4
new file mode 100644
index 00000000..eb8c5a67
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/aerial-pullback-rise-reveal/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/anime-skateboard-chase-nyc/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/anime-skateboard-chase-nyc/1/example.mp4
new file mode 100644
index 00000000..2b68bf93
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/anime-skateboard-chase-nyc/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/beach-stone-stop-motion/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/beach-stone-stop-motion/1/example.mp4
new file mode 100644
index 00000000..a903c2bf
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/beach-stone-stop-motion/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/bedroom-falling-book-catch/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/bedroom-falling-book-catch/1/example.mp4
new file mode 100644
index 00000000..664f9a55
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/bedroom-falling-book-catch/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4
new file mode 100644
index 00000000..1e861bab
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/brutalist-courtyard-martial-arts/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/brutalist-courtyard-martial-arts/1/example.mp4
new file mode 100644
index 00000000..a16e10f0
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/brutalist-courtyard-martial-arts/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/cinematic-roller-skating-action/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/cinematic-roller-skating-action/1/example.mp4
new file mode 100644
index 00000000..999056ae
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/cinematic-roller-skating-action/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/cinematic-shaolin-action/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/cinematic-shaolin-action/1/example.mp4
new file mode 100644
index 00000000..085bbe08
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/cinematic-shaolin-action/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/cliffside-roller-skating/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/cliffside-roller-skating/1/example.mp4
new file mode 100644
index 00000000..1a0d427e
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/cliffside-roller-skating/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/dolly-zoom-space-warp/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/dolly-zoom-space-warp/1/example.mp4
new file mode 100644
index 00000000..e6477e74
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/dolly-zoom-space-warp/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/drone-orbit-subject/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/drone-orbit-subject/1/example.mp4
new file mode 100644
index 00000000..3d9382ae
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/drone-orbit-subject/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/first-person-dragon-rider/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/first-person-dragon-rider/1/example.mp4
new file mode 100644
index 00000000..934e56bc
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/first-person-dragon-rider/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/fixed-point-pan-right-reveal/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/fixed-point-pan-right-reveal/1/example.mp4
new file mode 100644
index 00000000..67d9ba74
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/fixed-point-pan-right-reveal/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4
new file mode 100644
index 00000000..c76639aa
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/luxury-jewelry-unboxing/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/luxury-jewelry-unboxing/1/example.mp4
new file mode 100644
index 00000000..39146080
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/luxury-jewelry-unboxing/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/nyc-parkour-web-swing/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/nyc-parkour-web-swing/1/example.mp4
new file mode 100644
index 00000000..c4406e1f
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/nyc-parkour-web-swing/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/rack-focus-foreground-background/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/rack-focus-foreground-background/1/example.mp4
new file mode 100644
index 00000000..d2e9e06e
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/rack-focus-foreground-background/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/rainforest-mysterious-light/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/rainforest-mysterious-light/1/example.mp4
new file mode 100644
index 00000000..5b93ea45
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/rainforest-mysterious-light/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/recipe-infographic-cooking-sequence/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/recipe-infographic-cooking-sequence/1/example.mp4
new file mode 100644
index 00000000..60d9c659
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/recipe-infographic-cooking-sequence/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/sci-fi-motorcycle-action/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/sci-fi-motorcycle-action/1/example.mp4
new file mode 100644
index 00000000..80ee28d2
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/sci-fi-motorcycle-action/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/seoul-sunday-dv-home-video/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/seoul-sunday-dv-home-video/1/example.mp4
new file mode 100644
index 00000000..dce8df33
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/seoul-sunday-dv-home-video/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/vertical-crane-reveal/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/vertical-crane-reveal/1/example.mp4
new file mode 100644
index 00000000..8a6a59d6
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/vertical-crane-reveal/1/example.mp4 differ
diff --git a/assets/creator-preset-video-sources/video-generation/watercolor-sketch-parkour-chase/1/example.mp4 b/assets/creator-preset-video-sources/video-generation/watercolor-sketch-parkour-chase/1/example.mp4
new file mode 100644
index 00000000..c4cdbcdb
Binary files /dev/null and b/assets/creator-preset-video-sources/video-generation/watercolor-sketch-parkour-chase/1/example.mp4 differ
diff --git a/package.json b/package.json
index 3c7443ad..6f673b5a 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"templates:validate": "pnpm --filter @opencreator/daemon templates:validate",
"templates:compile": "pnpm --filter @opencreator/daemon templates:compile",
"templates:ci": "pnpm templates:validate && pnpm templates:compile",
+ "templates:preview-videos": "node scripts/optimize-creator-preview-videos.mjs",
"krillinai:build": "node scripts/build-krillinai.mjs",
"krillinai:package": "node scripts/package-krillinai-release.mjs",
"krillinai:test": "node scripts/build-krillinai.mjs --test-only"
diff --git a/scripts/optimize-creator-preview-videos.mjs b/scripts/optimize-creator-preview-videos.mjs
new file mode 100644
index 00000000..d1ce3cd4
--- /dev/null
+++ b/scripts/optimize-creator-preview-videos.mjs
@@ -0,0 +1,96 @@
+import { existsSync, mkdirSync, readdirSync, statSync } from 'node:fs';
+import { basename, dirname, extname, join, relative, resolve } from 'node:path';
+import { spawnSync } from 'node:child_process';
+import { fileURLToPath } from 'node:url';
+
+const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const sourceRoot = resolve(
+ process.env.OPENCREATOR_PREVIEW_SOURCE_ROOT
+ ?? join(rootDir, 'assets', 'creator-preset-video-sources', 'video-generation')
+);
+const outputRoot = resolve(
+ process.env.OPENCREATOR_PREVIEW_OUTPUT_ROOT
+ ?? join(rootDir, 'template', 'video-generation')
+);
+const maxDuration = Number(process.env.OPENCREATOR_PREVIEW_MAX_SECONDS ?? 8);
+const maxDimension = Number(process.env.OPENCREATOR_PREVIEW_MAX_DIMENSION ?? 640);
+const fps = Number(process.env.OPENCREATOR_PREVIEW_FPS ?? 15);
+const crf = Number(process.env.OPENCREATOR_PREVIEW_CRF ?? 29);
+const dryRun = process.argv.includes('--dry-run');
+
+if (!Number.isFinite(maxDuration) || maxDuration <= 0) {
+ throw new Error('OPENCREATOR_PREVIEW_MAX_SECONDS must be a positive number');
+}
+if (!Number.isInteger(maxDimension) || maxDimension < 128) {
+ throw new Error('OPENCREATOR_PREVIEW_MAX_DIMENSION must be an integer >= 128');
+}
+if (!Number.isInteger(fps) || fps < 1 || fps > 30) {
+ throw new Error('OPENCREATOR_PREVIEW_FPS must be an integer between 1 and 30');
+}
+if (!Number.isInteger(crf) || crf < 18 || crf > 40) {
+ throw new Error('OPENCREATOR_PREVIEW_CRF must be an integer between 18 and 40');
+}
+if (!existsSync(sourceRoot)) {
+ throw new Error(`Creator preview source directory does not exist: ${sourceRoot}`);
+}
+
+const sources = findMp4Files(sourceRoot);
+if (sources.length === 0) {
+ throw new Error(`No MP4 source videos found under ${sourceRoot}`);
+}
+
+for (const source of sources) {
+ const relativePath = relative(sourceRoot, source);
+ const output = join(outputRoot, relativePath);
+ mkdirSync(dirname(output), { recursive: true });
+ const args = [
+ '-hide_banner',
+ '-loglevel', 'error',
+ '-y',
+ '-i', source,
+ '-t', String(maxDuration),
+ '-map', '0:v:0',
+ '-map', '0:a:0?',
+ '-vf', `scale=${maxDimension}:${maxDimension}:force_original_aspect_ratio=decrease,fps=${fps}`,
+ '-c:v', 'libx264',
+ '-preset', 'medium',
+ '-crf', String(crf),
+ '-pix_fmt', 'yuv420p',
+ '-c:a', 'aac',
+ '-b:a', '64k',
+ '-ac', '2',
+ '-shortest',
+ '-map_metadata', '-1',
+ '-movflags', '+faststart',
+ output
+ ];
+ process.stdout.write(`${dryRun ? '[dry-run] ' : ''}${relativePath} -> ${relative(outputRoot, output)}\n`);
+ if (dryRun) continue;
+ const result = spawnSync('ffmpeg', args, { stdio: 'inherit' });
+ if (result.error !== undefined) {
+ throw new Error(`Unable to run ffmpeg: ${result.error.message}`);
+ }
+ if (result.status !== 0) {
+ throw new Error(`ffmpeg failed for ${relativePath} with exit code ${result.status}`);
+ }
+ const size = statSync(output).size;
+ if (size === 0) throw new Error(`ffmpeg produced an empty preview: ${output}`);
+}
+
+process.stdout.write(
+ `Processed ${sources.length} creator preview video(s) with `
+ + `${maxDuration}s/${maxDimension}px/${fps}fps/CRF${crf}.\n`
+);
+
+function findMp4Files(directory) {
+ const result = [];
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
+ const absolute = join(directory, entry.name);
+ if (entry.isDirectory()) {
+ result.push(...findMp4Files(absolute));
+ } else if (entry.isFile() && extname(entry.name).toLowerCase() === '.mp4') {
+ result.push(absolute);
+ }
+ }
+ return result.sort((left, right) => basename(left).localeCompare(basename(right)) || left.localeCompare(right));
+}
diff --git a/template/video-generation/aerial-pullback-rise-reveal/1/example.mp4 b/template/video-generation/aerial-pullback-rise-reveal/1/example.mp4
index eb8c5a67..3149a6e0 100644
Binary files a/template/video-generation/aerial-pullback-rise-reveal/1/example.mp4 and b/template/video-generation/aerial-pullback-rise-reveal/1/example.mp4 differ
diff --git a/template/video-generation/anime-skateboard-chase-nyc/1/example.mp4 b/template/video-generation/anime-skateboard-chase-nyc/1/example.mp4
index 2b68bf93..dec39a63 100644
Binary files a/template/video-generation/anime-skateboard-chase-nyc/1/example.mp4 and b/template/video-generation/anime-skateboard-chase-nyc/1/example.mp4 differ
diff --git a/template/video-generation/beach-stone-stop-motion/1/example.mp4 b/template/video-generation/beach-stone-stop-motion/1/example.mp4
index a903c2bf..dd52221d 100644
Binary files a/template/video-generation/beach-stone-stop-motion/1/example.mp4 and b/template/video-generation/beach-stone-stop-motion/1/example.mp4 differ
diff --git a/template/video-generation/bedroom-falling-book-catch/1/example.mp4 b/template/video-generation/bedroom-falling-book-catch/1/example.mp4
index 664f9a55..3a83d5e3 100644
Binary files a/template/video-generation/bedroom-falling-book-catch/1/example.mp4 and b/template/video-generation/bedroom-falling-book-catch/1/example.mp4 differ
diff --git a/template/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4 b/template/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4
index 1e861bab..6eab6f14 100644
Binary files a/template/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4 and b/template/video-generation/bioluminescent-lighthouse-keeper/1/example.mp4 differ
diff --git a/template/video-generation/brutalist-courtyard-martial-arts/1/example.mp4 b/template/video-generation/brutalist-courtyard-martial-arts/1/example.mp4
index a16e10f0..ef963de7 100644
Binary files a/template/video-generation/brutalist-courtyard-martial-arts/1/example.mp4 and b/template/video-generation/brutalist-courtyard-martial-arts/1/example.mp4 differ
diff --git a/template/video-generation/cinematic-roller-skating-action/1/example.mp4 b/template/video-generation/cinematic-roller-skating-action/1/example.mp4
index 999056ae..c7f4fe03 100644
Binary files a/template/video-generation/cinematic-roller-skating-action/1/example.mp4 and b/template/video-generation/cinematic-roller-skating-action/1/example.mp4 differ
diff --git a/template/video-generation/cinematic-shaolin-action/1/example.mp4 b/template/video-generation/cinematic-shaolin-action/1/example.mp4
index 085bbe08..caba1612 100644
Binary files a/template/video-generation/cinematic-shaolin-action/1/example.mp4 and b/template/video-generation/cinematic-shaolin-action/1/example.mp4 differ
diff --git a/template/video-generation/cliffside-roller-skating/1/example.mp4 b/template/video-generation/cliffside-roller-skating/1/example.mp4
index 1a0d427e..f66e310d 100644
Binary files a/template/video-generation/cliffside-roller-skating/1/example.mp4 and b/template/video-generation/cliffside-roller-skating/1/example.mp4 differ
diff --git a/template/video-generation/dolly-zoom-space-warp/1/example.mp4 b/template/video-generation/dolly-zoom-space-warp/1/example.mp4
index e6477e74..06a88dab 100644
Binary files a/template/video-generation/dolly-zoom-space-warp/1/example.mp4 and b/template/video-generation/dolly-zoom-space-warp/1/example.mp4 differ
diff --git a/template/video-generation/drone-orbit-subject/1/example.mp4 b/template/video-generation/drone-orbit-subject/1/example.mp4
index 3d9382ae..912c6641 100644
Binary files a/template/video-generation/drone-orbit-subject/1/example.mp4 and b/template/video-generation/drone-orbit-subject/1/example.mp4 differ
diff --git a/template/video-generation/first-person-dragon-rider/1/example.mp4 b/template/video-generation/first-person-dragon-rider/1/example.mp4
index 934e56bc..046c0310 100644
Binary files a/template/video-generation/first-person-dragon-rider/1/example.mp4 and b/template/video-generation/first-person-dragon-rider/1/example.mp4 differ
diff --git a/template/video-generation/fixed-point-pan-right-reveal/1/example.mp4 b/template/video-generation/fixed-point-pan-right-reveal/1/example.mp4
index 67d9ba74..1e8bf3a5 100644
Binary files a/template/video-generation/fixed-point-pan-right-reveal/1/example.mp4 and b/template/video-generation/fixed-point-pan-right-reveal/1/example.mp4 differ
diff --git a/template/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4 b/template/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4
index c76639aa..5c148922 100644
Binary files a/template/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4 and b/template/video-generation/japanese-influencer-get-ready-ugc/1/example.mp4 differ
diff --git a/template/video-generation/luxury-jewelry-unboxing/1/example.mp4 b/template/video-generation/luxury-jewelry-unboxing/1/example.mp4
index 39146080..da9bee4b 100644
Binary files a/template/video-generation/luxury-jewelry-unboxing/1/example.mp4 and b/template/video-generation/luxury-jewelry-unboxing/1/example.mp4 differ
diff --git a/template/video-generation/nyc-parkour-web-swing/1/example.mp4 b/template/video-generation/nyc-parkour-web-swing/1/example.mp4
index c4406e1f..920ff6da 100644
Binary files a/template/video-generation/nyc-parkour-web-swing/1/example.mp4 and b/template/video-generation/nyc-parkour-web-swing/1/example.mp4 differ
diff --git a/template/video-generation/rack-focus-foreground-background/1/example.mp4 b/template/video-generation/rack-focus-foreground-background/1/example.mp4
index d2e9e06e..7cd1adb7 100644
Binary files a/template/video-generation/rack-focus-foreground-background/1/example.mp4 and b/template/video-generation/rack-focus-foreground-background/1/example.mp4 differ
diff --git a/template/video-generation/rainforest-mysterious-light/1/example.mp4 b/template/video-generation/rainforest-mysterious-light/1/example.mp4
index 5b93ea45..64c3766c 100644
Binary files a/template/video-generation/rainforest-mysterious-light/1/example.mp4 and b/template/video-generation/rainforest-mysterious-light/1/example.mp4 differ
diff --git a/template/video-generation/recipe-infographic-cooking-sequence/1/example.mp4 b/template/video-generation/recipe-infographic-cooking-sequence/1/example.mp4
index 60d9c659..f1d577f9 100644
Binary files a/template/video-generation/recipe-infographic-cooking-sequence/1/example.mp4 and b/template/video-generation/recipe-infographic-cooking-sequence/1/example.mp4 differ
diff --git a/template/video-generation/sci-fi-motorcycle-action/1/example.mp4 b/template/video-generation/sci-fi-motorcycle-action/1/example.mp4
index 80ee28d2..44ed0863 100644
Binary files a/template/video-generation/sci-fi-motorcycle-action/1/example.mp4 and b/template/video-generation/sci-fi-motorcycle-action/1/example.mp4 differ
diff --git a/template/video-generation/seoul-sunday-dv-home-video/1/example.mp4 b/template/video-generation/seoul-sunday-dv-home-video/1/example.mp4
index dce8df33..98cfe203 100644
Binary files a/template/video-generation/seoul-sunday-dv-home-video/1/example.mp4 and b/template/video-generation/seoul-sunday-dv-home-video/1/example.mp4 differ
diff --git a/template/video-generation/vertical-crane-reveal/1/example.mp4 b/template/video-generation/vertical-crane-reveal/1/example.mp4
index 8a6a59d6..077af115 100644
Binary files a/template/video-generation/vertical-crane-reveal/1/example.mp4 and b/template/video-generation/vertical-crane-reveal/1/example.mp4 differ
diff --git a/template/video-generation/watercolor-sketch-parkour-chase/1/example.mp4 b/template/video-generation/watercolor-sketch-parkour-chase/1/example.mp4
index c4cdbcdb..4c8edc8f 100644
Binary files a/template/video-generation/watercolor-sketch-parkour-chase/1/example.mp4 and b/template/video-generation/watercolor-sketch-parkour-chase/1/example.mp4 differ