Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

Release 2.7.12

Nika Siradzef35d7f282b20
diff --git a/cli/VERSION b/cli/VERSION
index af9c448..4712731 100644
--- a/cli/VERSION
+++ b/cli/VERSION
@@ -1 +1 @@
-2.7.11
+2.7.12
diff --git a/package-lock.json b/package-lock.json
index c5bccf4..693a3e1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "podcli",
- "version": "2.7.11",
+ "version": "2.7.12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "podcli",
- "version": "2.7.11",
+ "version": "2.7.12",
"license": "AGPL-3.0-only",
"dependencies": {
"@fontsource/dm-sans": "^5.3.0",
diff --git a/package.json b/package.json
index 2446dae..1446cff 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "podcli",
- "version": "2.7.11",
+ "version": "2.7.12",
"private": true,
"description": "AI-powered podcast clip generator for TikTok/YouTube Shorts. Transcribe, find viral moments, export vertical clips with burned captions.",
"type": "module",
diff --git a/src/models/index.ts b/src/models/index.ts
index 2148b48..2d86374 100644
--- a/src/models/index.ts
+++ b/src/models/index.ts
@@ -308,6 +308,8 @@ export interface ClipHistoryEntry {
created_at: string;
content_type?: string;
transcript_slice?: string;
+ logo_backup_path?: string;
+ logo_position?: string;
keep_segments?: Array<{ start: number; end: number }>;
thumbnail_config?: ClipThumbnailConfig;
youtube_video_id?: string;
diff --git a/src/ui/client/ClipDetail.tsx b/src/ui/client/ClipDetail.tsx
index 5b2cfaa..d3f707b 100644
--- a/src/ui/client/ClipDetail.tsx
+++ b/src/ui/client/ClipDetail.tsx
@@ -6,6 +6,7 @@ import ClipPlayer from "./ClipPlayer";
import { BackIcon } from "./icons";
import ReframeEditor from "./ReframeEditor";
import CopyButton from "./CopyButton";
+import AssetPicker from "./AssetPicker";
interface ThumbnailConfig {
text?: string;
@@ -28,6 +29,9 @@ interface Clip {
duration: number;
file_size_mb?: number;
output_path: string;
+ logo_path?: string;
+ logo_backup_path?: string;
+ logo_position?: string;
created_at: string;
content_type?: string;
transcript_slice?: string;
@@ -39,6 +43,7 @@ interface Clip {
}
const CAPTION_STYLES = ["branded", "hormozi", "karaoke", "subtle"];
+const LOGO_POSITIONS = ["top-left", "top-right", "bottom-left", "bottom-right"];
const img = (p: string, bust: number) => `/api/image?path=${encodeURIComponent(p)}&t=${bust}`;
export default function ClipDetail() {
@@ -63,6 +68,9 @@ export default function ClipDetail() {
const [bust, setBust] = useState(1);
const [davinciOn, setDavinciOn] = useState(false);
const [reframing, setReframing] = useState(false);
+ const [logoPath, setLogoPath] = useState("");
+ const [logoPosition, setLogoPosition] = useState("top-right");
+ const [logoPreviews, setLogoPreviews] = useState<Array<{ position: string; path: string }>>([]);
const load = () => {
api("/history?limit=500")
@@ -72,6 +80,8 @@ export default function ClipDetail() {
if (found) {
setTitle(found.title);
setCaptionStyle(found.caption_style);
+ setLogoPath(found.logo_path || "");
+ setLogoPosition(found.logo_position || "top-right");
const tc = found.thumbnail_config || {};
setLine1(tc.line1 ?? "");
setLine2(tc.line2 ?? "");
@@ -142,6 +152,42 @@ export default function ClipDetail() {
} catch (e: any) { setMsg(`Generate failed: ${e.message}`); setMsgErr(true); } finally { setBusy(null); }
};
+ const loadLogoPreviews = async () => {
+ if (!logoPath) { setMsg("Select a logo first"); setMsgErr(true); return; }
+ setBusy("logo-preview"); setMsg(null); setMsgErr(false);
+ try {
+ const r = await api(`/clips/${clip.id}/logo/previews?logo_path=${encodeURIComponent(logoPath)}`);
+ if (r.error) throw new Error(r.error);
+ setLogoPreviews(r.previews || []);
+ if (r.previews?.[0]?.position) setLogoPosition(r.previews[0].position);
+ } catch (e: any) { setMsg(`Logo previews failed: ${e.message}`); setMsgErr(true); } finally { setBusy(null); }
+ };
+
+ const applyLogo = async () => {
+ if (!logoPath) { setMsg("Select a logo first"); setMsgErr(true); return; }
+ setBusy("logo-apply"); setMsg(null); setMsgErr(false);
+ try {
+ const r = await api(`/clips/${clip.id}/logo`, {
+ method: "POST",
+ body: JSON.stringify({ action: "apply", logo_path: logoPath, logo_position: logoPosition }),
+ });
+ if (r.error) throw new Error(r.error);
+ setBust(Date.now()); load();
+ setMsg("Logo applied. Backup saved for removal"); setMsgErr(false);
+ } catch (e: any) { setMsg(`Logo apply failed: ${e.message}`); setMsgErr(true); } finally { setBusy(null); }
+ };
+
+ const removeLogo = async () => {
+ setBusy("logo-remove"); setMsg(null); setMsgErr(false);
+ try {
+ const r = await api(`/clips/${clip.id}/logo`, { method: "POST", body: JSON.stringify({ action: "remove" }) });
+ if (r.error) throw new Error(r.error);
+ setLogoPreviews([]);
+ setBust(Date.now()); load();
+ setMsg("Logo removed from backup"); setMsgErr(false);
+ } catch (e: any) { setMsg(`Logo remove failed: ${e.message}`); setMsgErr(true); } finally { setBusy(null); }
+ };
+
// Pull a different frame from the clip (cycles the ranked candidates) and
// re-render — same one-click flow as Regenerate, but swaps the background frame.
const newFrame = async () => {
@@ -260,6 +306,43 @@ export default function ClipDetail() {
</div>
</div>
+ <div className="section">
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 10 }}>
+ <label style={{ ...labelStyle, marginBottom: 0 }}>Logo</label>
+ {clip.logo_backup_path && <span className="hint">Backup ready</span>}
+ </div>
+ <div style={{ display: "flex", gap: 10, alignItems: "flex-end", flexWrap: "wrap" }}>
+ <AssetPicker type="logo" value={logoPath} onChange={(p) => { setLogoPath(p); setLogoPreviews([]); }} disabled={busy !== null} />
+ <button className="btn btn-ghost btn-sm" onClick={loadLogoPreviews} disabled={busy !== null || !logoPath}>
+ {busy === "logo-preview" ? <><div className="spinner sm" /> Loading…</> : "Preview"}
+ </button>
+ <button className="btn btn-primary btn-sm" onClick={applyLogo} disabled={busy !== null || !logoPath}>
+ {busy === "logo-apply" ? <div className="spinner sm" /> : "Apply"}
+ </button>
+ <button className="btn btn-danger btn-sm" onClick={removeLogo} disabled={busy !== null || !clip.logo_backup_path}>
+ {busy === "logo-remove" ? <div className="spinner sm" /> : "Remove"}
+ </button>
+ </div>
+ {logoPreviews.length > 0 ? (
+ <div className="thumb-variations" style={{ marginTop: 12 }}>
+ {logoPreviews.map((preview) => (
+ <button key={preview.position} className={`thumb-variation ${logoPosition === preview.position ? "selected" : ""}`} onClick={() => setLogoPosition(preview.position)} disabled={busy !== null} title={preview.position}>
+ <img src={img(preview.path, bust)} alt={preview.position} />
+ </button>
+ ))}
+ </div>
+ ) : (
+ <div className="hint" style={{ marginTop: 8 }}>Preview a few placements, select one, then apply.</div>
+ )}
+ <div style={{ display: "flex", gap: 6, flexWrap: "wrap", marginTop: 10 }}>
+ {LOGO_POSITIONS.map((position) => (
+ <button key={position} className={`btn btn-ghost btn-sm ${logoPosition === position ? "selected" : ""}`} onClick={() => setLogoPosition(position)} disabled={busy !== null}>
+ {position}
+ </button>
+ ))}
+ </div>
+ </div>
+
<div className="section">
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 10 }}>
<label style={{ ...labelStyle, marginBottom: 0 }}>Thumbnail</label>
diff --git a/src/ui/web-server.ts b/src/ui/web-server.ts
index cb5ada1..b83f183 100644
--- a/src/ui/web-server.ts
+++ b/src/ui/web-server.ts
@@ -20,7 +20,7 @@ import {
chmodSync,
realpathSync,
} from "fs";
-import { mkdir, readdir, unlink } from "fs/promises";
+import { copyFile, mkdir, readdir, rename, unlink } from "fs/promises";
import path from "path";
import { join, dirname, basename, extname, resolve } from "path";
import { execSync, execFileSync, spawn } from "child_process";
@@ -2467,6 +2467,45 @@ function runPy(scriptAndArgs: string[]): Promise<{ code: number; stdout: string;
const runCli = (args: string[]) =>
runPy([join(paths.backendDir, "cli.py"), "--no-banner", ...args]);
+const LOGO_POSITIONS = ["top-left", "top-right", "bottom-left", "bottom-right"] as const;
+type LogoPosition = (typeof LOGO_POSITIONS)[number];
+
+function logoOverlayExpr(position: string, margin = 108): string {
+ const x = position.endsWith("right") ? `main_w-overlay_w-${margin}` : String(margin);
+ const y = position.startsWith("bottom") ? `main_h-overlay_h-${margin}` : String(margin);
+ return `${x}:${y}`;
+}
+
+function runFfmpeg(args: string[], timeoutMs = 120_000): Promise<{ code: number; stdout: string; stderr: string }> {
+ return new Promise((resolve) => {
+ const proc = spawn(paths.ffmpegPath, args, { detached: process.platform !== "win32" });
+ let stdout = "", stderr = "";
+ let settled = false;
+ const finish = (result: { code: number; stdout: string; stderr: string }) => {
+ if (settled) return;
+ settled = true;
+ clearTimeout(timer);
+ resolve(result);
+ };
+ const timer = setTimeout(() => {
+ terminateProcessTree(proc);
+ finish({ code: 1, stdout, stderr: `${stderr}\nTimed out after ${timeoutMs / 1000}s`.trim() });
+ }, timeoutMs);
+ proc.stdout.on("data", (d) => (stdout += d));
+ proc.stderr.on("data", (d) => (stderr += d));
+ proc.on("close", (code) => finish({ code: code ?? 1, stdout, stderr }));
+ proc.on("error", (e) => finish({ code: 1, stdout, stderr: String(e) }));
+ });
+}
+
+async function resolveLogoPath(input: unknown): Promise<string | null> {
+ const raw = String(input || "").trim();
+ if (!raw) return null;
+ const resolvedLogo = await assetManager.resolve(raw);
+ if (!resolvedLogo || !existsSync(resolvedLogo)) return null;
+ return resolvedLogo;
+}
+
// Composite a thumbnail PNG onto the start of a clip. stripStart > 0 removes a
// prior card first (avoids stacking on re-bake). Returns the bake's success.
async function bakeThumbnailCard(clipPath: string, image: string, stripStart = 0): Promise<{ ok: boolean; error?: string }> {
@@ -2649,6 +2688,98 @@ app.post("/api/clips/:id/thumbnail/render", async (req, res) => {
res.json({ ok: true, preview_path: outPath });
});
+app.get("/api/clips/:id/logo/previews", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) { res.status(404).json({ error: "clip not found" }); return; }
+ if (!clip.output_path || !existsSync(clip.output_path)) { res.status(400).json({ error: "rendered file missing" }); return; }
+ const logo = await resolveLogoPath(req.query.logo_path);
+ if (!logo) { res.status(400).json({ error: "select a logo first" }); return; }
+ const baseVideo = clip.logo_backup_path && existsSync(clip.logo_backup_path)
+ ? clip.logo_backup_path
+ : clip.output_path;
+ const outDir = join(paths.output, "logo-previews", String(clip.id));
+ await mkdir(outDir, { recursive: true });
+ const previews = [];
+ for (const position of LOGO_POSITIONS) {
+ const out = join(outDir, `${position}.jpg`);
+ const r = await runFfmpeg([
+ "-y",
+ "-ss", String(Math.max(0, Math.min(1, (clip.duration || 1) / 3))),
+ "-i", baseVideo,
+ "-i", logo,
+ "-filter_complex", `[1:v]scale=-1:126[logo];[0:v][logo]overlay=${logoOverlayExpr(position)}[v]`,
+ "-map", "[v]",
+ "-frames:v", "1",
+ "-q:v", "3",
+ out,
+ ]);
+ if (r.code !== 0 || !existsSync(out)) {
+ res.status(400).json({ error: stripAnsi(r.stderr) || "preview failed" });
+ return;
+ }
+ previews.push({ position, path: out });
+ }
+ res.json({ previews });
+});
+
+app.post("/api/clips/:id/logo", async (req, res) => {
+ if (DEMO) { res.json({ ok: true }); return; }
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) { res.status(404).json({ error: "clip not found" }); return; }
+ if (!clip.output_path || !existsSync(clip.output_path)) { res.status(400).json({ error: "rendered file missing" }); return; }
+ const action = String(req.body?.action || "apply");
+ if (action === "remove") {
+ const backup = clip.logo_backup_path;
+ if (!backup || !existsSync(backup)) {
+ res.status(400).json({ error: "no logo backup available" });
+ return;
+ }
+ await copyFile(backup, clip.output_path);
+ await clipsHistory.update(clip.id, { logo_path: "", logo_backup_path: "", logo_position: "" });
+ broadcastSSE("history-updated", { jobId: null, count: 1 });
+ res.json({ ok: true, restored_from: backup });
+ return;
+ }
+ const logo = await resolveLogoPath(req.body?.logo_path);
+ if (!logo) { res.status(400).json({ error: "select a logo first" }); return; }
+ const position = LOGO_POSITIONS.includes(req.body?.logo_position) ? req.body.logo_position as LogoPosition : "top-right";
+ const backup = clip.logo_backup_path && existsSync(clip.logo_backup_path)
+ ? clip.logo_backup_path
+ : `${clip.output_path}.pre-logo.mp4`;
+ if (!existsSync(backup)) await copyFile(clip.output_path, backup);
+ const baseVideo = existsSync(backup) ? backup : clip.output_path;
+ const tmp = `${clip.output_path}.logo-${process.pid}.mp4`;
+ const r = await runFfmpeg([
+ "-y",
+ "-i", baseVideo,
+ "-i", logo,
+ "-filter_complex", `[1:v]scale=-1:126[logo];[0:v][logo]overlay=${logoOverlayExpr(position)}[v]`,
+ "-map", "[v]",
+ "-map", "0:a?",
+ "-c:v", "libx264",
+ "-preset", "veryfast",
+ "-crf", "18",
+ "-pix_fmt", "yuv420p",
+ "-c:a", "copy",
+ "-movflags", "+faststart",
+ tmp,
+ ], 15 * 60_000);
+ if (r.code !== 0 || !existsSync(tmp)) {
+ res.status(400).json({ error: stripAnsi(r.stderr) || "logo apply failed" });
+ return;
+ }
+ await rename(tmp, clip.output_path);
+ const size = statSync(clip.output_path).size / 1024 / 1024;
+ await clipsHistory.update(clip.id, {
+ logo_path: logo,
+ logo_backup_path: backup,
+ logo_position: position,
+ file_size_mb: Math.round(size * 10) / 10,
+ });
+ broadcastSSE("history-updated", { jobId: null, count: 1 });
+ res.json({ ok: true, logo_path: logo, logo_position: position, backup_path: backup });
+});
+
// --- Thumbnail studio (standalone thumbnails, no clip required) ---
const thumbStudioDir = join(paths.output, "thumbnails", "studio");