From a9959eca11bd778af1e42966743ae38136247582 Mon Sep 17 00:00:00 2001 From: sueddie273-ai <266692292+sueddie273-ai@users.noreply.github.com> Date: Thu, 3 Dec 2026 16:35:15 +0800 Subject: [PATCH 1/2] Open editable video examples from the README Signed-off-by: sueddie273-ai <266692292+sueddie273-ai@users.noreply.github.com> --- README.md | 18 ++-- README.zh-CN.md | 18 ++-- scripts/showcase-video/README.md | 13 +++ scripts/showcase-video/build.mjs | 37 +++++++ scripts/showcase-video/host.ts | 174 ++++++++++++++++++++++++++++++ scripts/showcase-video/prepare.ts | 86 +++++++++++++++ scripts/showcase-video/session.ts | 109 +++++++++++++++++++ scripts/showcase-video/utf8.ts | 1 + 8 files changed, 438 insertions(+), 18 deletions(-) create mode 100644 scripts/showcase-video/README.md create mode 100644 scripts/showcase-video/build.mjs create mode 100644 scripts/showcase-video/host.ts create mode 100644 scripts/showcase-video/prepare.ts create mode 100644 scripts/showcase-video/session.ts create mode 100644 scripts/showcase-video/utf8.ts diff --git a/README.md b/README.md index 5851a311..da166b2f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
The world’s first project that remakes both videos and image posts, built to recreate viral social content.
@@ -39,7 +39,7 @@ -Install Popost and try a remake · ⭐ Star this Skill for your next project
@@ -104,7 +104,7 @@ See the [Skill instructions](./skills/popost/SKILL.md) or use the [web app](http [Creative ads](#case-18) · [Product promos](#case-22) · [Motion design](#case-14) · [AI presenters](#case-17) · [Animation](#case-24) · [Explainers](#case-04) -These six video remake examples each include the reference, the Popost remake, and an adaptation brief. Animated images show opening excerpts; click to watch the full videos. +These six video remake examples each include the reference, the Popost remake, and an adaptation brief. Click an animated preview to watch the full video. Open the video editor to play and edit a copy of the project in your browser tab. @@ -120,7 +120,7 @@ These six video remake examples each include the reference, the Popost remake, a > Use Popost to remake this viral video, following its style, structure, and hook. My content: Replace CeraVe with Colgate and the sandworm keeper with a dragon dentist. He complains that one tooth takes forever to brush—then a dragon opens its mouth. Spoken in English. -[Source and creator](https://x.com/DiscussingFilm/status/2122428691758108871) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-18-reference-4c8cf384f770.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-18-remake-296c77c3cde1.mp4) +[Source and creator](https://x.com/DiscussingFilm/status/2122428691758108871) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-18-reference-4c8cf384f770.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-18-remake-296c77c3cde1.mp4) · [Open video editor](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-18/en.html) @@ -136,7 +136,7 @@ These six video remake examples each include the reference, the Popost remake, a > Use Popost to remake this viral video, following its style, structure, and hook. My content: Replace Grok Bot with Popost. Three coworkers send Instagram, TikTok, and X links, and their AI agent remakes the posts for their own content. -[Source and creator](https://x.com/bot/status/2120582957782200586) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-22-reference-faa72c145d4b.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-22-remake-b4339f308ab5.mp4) +[Source and creator](https://x.com/bot/status/2120582957782200586) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-22-reference-faa72c145d4b.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-22-remake-b4339f308ab5.mp4) · [Open video editor](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-22/en.html) @@ -152,7 +152,7 @@ These six video remake examples each include the reference, the Popost remake, a > Use Popost to remake this viral video, following its style, structure, and hook. My content: Change the copy to “Just five minutes”: five minutes become five hours, the clock turns into dark circles, and the last line is “I’ll go to bed early tomorrow.” Text in English. -[Source and creator](https://x.com/ChrisGPT/status/2119998815856218494) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-14-reference-8615036ae278.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-14-remake-6271077c7d47.mp4) +[Source and creator](https://x.com/ChrisGPT/status/2119998815856218494) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-14-reference-8615036ae278.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-14-remake-6271077c7d47.mp4) · [Open video editor](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-14/en.html) @@ -168,7 +168,7 @@ These six video remake examples each include the reference, the Popost remake, a > Use Popost to remake this viral video, following its style, structure, and hook. My content: Replace the woman with an American male fitness coach: “My face. My voice. But the me telling you to get up is still in bed.” -[Source and creator](https://x.com/UchegbuPeaceM/status/2116098525318574097) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-17-reference-a8397cf69426.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-17-remake-f2c703c525bd.mp4) +[Source and creator](https://x.com/UchegbuPeaceM/status/2116098525318574097) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-17-reference-a8397cf69426.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-17-remake-f2c703c525bd.mp4) · [Open video editor](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-17/en.html) @@ -184,7 +184,7 @@ These six video remake examples each include the reference, the Popost remake, a > Use Popost to remake this viral video, following its style, structure, and hook. My content: Replace the black cat with a corgi who owes a pigeon gang 300 fries. The Venice chase becomes its adventure to repay the debt. Spoken in English. -[Source and creator](https://x.com/Pixar/status/2120924590968860697) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-24-reference-60aecdb07c13.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-24-remake-8f6519ebaa27.mp4) +[Source and creator](https://x.com/Pixar/status/2120924590968860697) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-24-reference-60aecdb07c13.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-24-remake-8f6519ebaa27.mp4) · [Open video editor](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-24/en.html) @@ -200,7 +200,7 @@ These six video remake examples each include the reference, the Popost remake, a > Use Popost to remake this viral video, following its style, structure, and hook. My content: Change the topic to Clipcat: 30,000+ real viral commerce videos, free prompts, and a way to remake an idea for your own product. Narrated in Chinese by a male voice. -[Source and creator](https://www.douyin.com/video/7699110937210522915) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-04-reference-4f0988470589.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-04-remake-0e3551ebe98a.mp4) +[Source and creator](https://www.douyin.com/video/7699110937210522915) · [Full reference](https://static.popost.ai/readme/video-showcase-20261129/case-04-reference-4f0988470589.mp4) · [Full remake](https://static.popost.ai/readme/video-showcase-20261129/case-04-remake-0e3551ebe98a.mp4) · [Open video editor](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-04/en.html) diff --git a/README.zh-CN.md b/README.zh-CN.md index 3983a27d..43a0b180 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,6 @@全球首个同时支持视频和图文类型复刻的项目,真正的爆款社媒复刻
@@ -39,7 +39,7 @@ -安装 Popost 开始复刻 · ⭐ Star 收藏,下次直接找到这个 Skill
@@ -106,7 +106,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 [品牌创意广告](#case-18) · [产品宣传片](#case-22) · [Motion 动效](#case-14) · [数字人口播](#case-17) · [动漫](#case-24) · [知识讲解](#case-04) -下面是六种视频复刻案例。每组都附参考、复刻成片和一句改编要求。左右动图为开场节选,点击可看完整视频。 +下面是六种视频复刻案例。每组都附参考、复刻成片和一句改编要求。左右动图为开场节选,点击可看完整视频。打开视频编辑器即可播放并修改案例副本,改动只保存在当前浏览器标签页。 @@ -122,7 +122,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 > 用popost复刻做同款爆款,参考原视频的风格、结构、钩子,我的内容是:把CeraVe换成高露洁,沙虫饲养员换成龙牙医,他一本正经地抱怨一颗牙要刷半天,最后张开的是巨龙的嘴。口播是英文。 -[原帖与作者](https://x.com/DiscussingFilm/status/2122428691758108871) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-18-reference-4c8cf384f770.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-18-remake-296c77c3cde1.mp4) +[原帖与作者](https://x.com/DiscussingFilm/status/2122428691758108871) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-18-reference-4c8cf384f770.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-18-remake-296c77c3cde1.mp4) · [打开视频编辑器](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-18/zh.html) @@ -138,7 +138,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 > 用popost复刻做同款爆款,参考原视频的风格、结构、钩子,我的内容是:把Grok Bot换成Popost,三个同事分别丢来Instagram、TikTok和X链接,AI Agent把它们做出同款爆款。 -[原帖与作者](https://x.com/bot/status/2120582957782200586) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-22-reference-faa72c145d4b.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-22-remake-b4339f308ab5.mp4) +[原帖与作者](https://x.com/bot/status/2120582957782200586) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-22-reference-faa72c145d4b.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-22-remake-b4339f308ab5.mp4) · [打开视频编辑器](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-22/zh.html) @@ -154,7 +154,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 > 用popost复刻做同款爆款,参考原视频的风格、结构、钩子,我的内容是:把文案换成“我只看五分钟”:五分钟变成五小时,时钟转成黑眼圈,最后只剩一句“明天一定早睡”。文案是英文。 -[原帖与作者](https://x.com/ChrisGPT/status/2119998815856218494) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-14-reference-8615036ae278.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-14-remake-6271077c7d47.mp4) +[原帖与作者](https://x.com/ChrisGPT/status/2119998815856218494) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-14-reference-8615036ae278.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-14-remake-6271077c7d47.mp4) · [打开视频编辑器](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-14/zh.html) @@ -170,7 +170,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 > 用popost复刻做同款爆款,参考原视频的风格、结构、钩子,我的内容是:把女生换成美国男生健身教练,让他说“脸是我的,声音也是我的,但今天催你起床的我,还没起床”。 -[原帖与作者](https://x.com/UchegbuPeaceM/status/2116098525318574097) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-17-reference-a8397cf69426.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-17-remake-f2c703c525bd.mp4) +[原帖与作者](https://x.com/UchegbuPeaceM/status/2116098525318574097) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-17-reference-a8397cf69426.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-17-remake-f2c703c525bd.mp4) · [打开视频编辑器](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-17/zh.html) @@ -186,7 +186,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 > 用popost复刻做同款爆款,参考原视频的风格、结构、钩子,我的内容是:把小黑猫换成一只欠了鸽子黑帮三百根薯条的柯基,威尼斯追逐战变成它的还债大冒险。口播是英文。 -[原帖与作者](https://x.com/Pixar/status/2120924590968860697) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-24-reference-60aecdb07c13.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-24-remake-8f6519ebaa27.mp4) +[原帖与作者](https://x.com/Pixar/status/2120924590968860697) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-24-reference-60aecdb07c13.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-24-remake-8f6519ebaa27.mp4) · [打开视频编辑器](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-24/zh.html) @@ -202,7 +202,7 @@ Popost 本身免费使用。你本地使用的 Agent 和模型服务各有自己 > 用popost复刻做同款爆款,参考原视频的风格、结构、钩子,我的内容是:把主题换成Clipcat:3万多真实爆款带货视频,免费查看和复制提示词,找到灵感后直接复刻自己的带货视频。用中文男声讲解。 -[原帖与作者](https://www.douyin.com/video/7699110937210522915) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-04-reference-4f0988470589.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-04-remake-0e3551ebe98a.mp4) +[原帖与作者](https://www.douyin.com/video/7699110937210522915) · [完整参考视频](https://static.popost.ai/readme/video-showcase-20261129/case-04-reference-4f0988470589.mp4) · [完整复刻视频](https://static.popost.ai/readme/video-showcase-20261129/case-04-remake-0e3551ebe98a.mp4) · [打开视频编辑器](https://static.popost.ai/readme/video-studio-20261203-94424279cb20/case-04/zh.html) diff --git a/scripts/showcase-video/README.md b/scripts/showcase-video/README.md new file mode 100644 index 00000000..703f4cad --- /dev/null +++ b/scripts/showcase-video/README.md @@ -0,0 +1,13 @@ +# README video previews + +The public sample uses the same editor shell, timeline compiler, and edit operations as `popost video preview --edit`. The browser loads a published project snapshot into a tab-local draft. Cloud sync, project uploads, and server-side exports are unavailable in this host. + +Build the static files with Node and FFmpeg after running `npm ci`. + +```sh +node scripts/showcase-video/build.mjs cases.json path/to/new-output-directory +``` + +The input is a JSON array. Each entry has an `id` such as `case-18`, the path to its approved project directory in `project`, the path to its published MP4 in `video`, and `titles` with `en` and `zh` labels. List additional dependencies referenced within the scene HTML and scripts in `sceneAssets`, using project-relative paths. Include applicable licenses with third-party scene scripts. + +Serve the output over HTTPS or localhost. Open `case-18/en.html` or `case-18/zh.html` to test both languages. Before deployment, verify playback and an edit in each case, and open a fresh tab to check that it starts from the published snapshot. Publish the generated folder under a new versioned prefix on the public media host, then update the two README files. diff --git a/scripts/showcase-video/build.mjs b/scripts/showcase-video/build.mjs new file mode 100644 index 00000000..159b582f --- /dev/null +++ b/scripts/showcase-video/build.mjs @@ -0,0 +1,37 @@ +import { build } from 'esbuild'; +import { mkdtemp, readFile, rm } from 'node:fs/promises'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const [manifest, destination] = process.argv.slice(2); +if (!manifest || !destination) throw new Error('Usage: node scripts/showcase-video/build.mjs CASES.json OUTPUT'); +const here = dirname(fileURLToPath(import.meta.url)); +const output = resolve(destination); +const temporary = await mkdtemp(join(here, '../../node_modules/.showcase-video-')); +try { + const prepare = join(temporary, 'prepare.mjs'); + await build({ + entryPoints: [join(here, 'prepare.ts')], outfile: prepare, bundle: true, + platform: 'node', format: 'esm', packages: 'external', + }); + const generator = await import(pathToFileURL(prepare).href); + await generator.prepare(output, JSON.parse(await readFile(manifest, 'utf8'))); +} finally { + await rm(temporary, { recursive: true, force: true }); +} + +const browser = await build({ + entryPoints: [join(here, 'host.ts')], outfile: join(output, 'host.js'), bundle: true, + platform: 'browser', format: 'esm', target: 'es2022', minify: true, metafile: true, + inject: [join(here, 'utf8.ts')], + define: { 'Buffer.byteLength': 'utf8ByteLength' }, + plugins: [{ + name: 'separate-node-utilities', + setup(builder) { + builder.onResolve({ filter: /^node:/ }, ({ path }) => ({ path, external: true, sideEffects: false })); + }, + }], +}); +if (Object.values(browser.metafile.outputs).some((file) => file.imports.some((item) => item.external && item.path !== '../studio.js'))) { + throw new Error('The browser Studio host retained a Node dependency'); +} diff --git a/scripts/showcase-video/host.ts b/scripts/showcase-video/host.ts new file mode 100644 index 00000000..b6325ad1 --- /dev/null +++ b/scripts/showcase-video/host.ts @@ -0,0 +1,174 @@ +import { compilePage } from '../../skills/popost/src/video/compile/page'; +import type { StudioComment, StudioVersion } from '../../skills/popost/src/video/preview/studio-data'; +import { createSession, type Sample } from './session'; + +const nativeFetch = window.fetch.bind(window); +const folder = new URL('./', location.href); +const project = new URL('project/', folder); +const draftKey = 'popost-showcase:' + folder.pathname; +const lang = document.documentElement.lang === 'zh-CN' ? 'zh' : 'en'; +const json = (body: unknown, status = 200) => + new Response(JSON.stringify(body), { status, headers: { 'content-type': 'application/json' } }); +const unavailable = () => json({ ok: false, problems: [{ + level: 'error', at: '(demo)', message: lang === 'zh' ? '浏览器演示暂不支持此操作。' : 'This action is unavailable in the browser demo.', +}] }, 422); + +function readDraft(): unknown { + try { return JSON.parse(sessionStorage.getItem(draftKey) ?? 'null') ?? undefined; } catch { return undefined; } +} + +// The same Studio uses these virtual URLs when it runs behind the local CLI server. +function mapProjectPath(input: string, base: string) { + return input.startsWith('/project/') ? base + input.slice('/project/'.length) : input; +} + +function start(sample: Sample) { + const session = createSession(sample, lang, readDraft(), (source) => { + try { sessionStorage.setItem(draftKey, JSON.stringify(source)); } catch { /* The active draft stays in memory. */ } + }); + if (!session.state().resolved) throw new Error('Invalid showcase project'); + + const versions: (StudioVersion & { source: unknown })[] = []; + const comments: StudioComment[] = []; + const hash = async () => Array.from(new Uint8Array(await crypto.subtle.digest( + 'SHA-256', new TextEncoder().encode(JSON.stringify(session.state().source)), + )), (byte) => byte.toString(16).padStart(2, '0')).join(''); + + async function read(path: string) { + switch (path) { + case '/api/state': return json(session.state()); + case '/api/source': return json(session.state().source); + case '/api/schema': return nativeFetch(new URL('../schema.json', folder)); + case '/api/cloud/status': return json({ mode: 'off', configured: false }); + case '/api/export-options': return json({ premium: false, verified: false }); + case '/api/studio': return json({ + hash: await hash(), slots: session.slots(), comments, + versions: versions.map(({ source: _source, ...version }) => version), lastExport: null, + }); + default: return unavailable(); + } + } + async function edit(path: string, body: Record