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.13

Nika Siradze9884103af1f8
diff --git a/cli/VERSION b/cli/VERSION
index 4712731..ecc17b8 100644
--- a/cli/VERSION
+++ b/cli/VERSION
@@ -1 +1 @@
-2.7.12
+2.7.13
diff --git a/package-lock.json b/package-lock.json
index 693a3e1..0d947c4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "podcli",
- "version": "2.7.12",
+ "version": "2.7.13",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "podcli",
- "version": "2.7.12",
+ "version": "2.7.13",
"license": "AGPL-3.0-only",
"dependencies": {
"@fontsource/dm-sans": "^5.3.0",
diff --git a/package.json b/package.json
index 1446cff..5cdfc7a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "podcli",
- "version": "2.7.12",
+ "version": "2.7.13",
"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/ui/client/ClipDetail.tsx b/src/ui/client/ClipDetail.tsx
index d3f707b..eb4d59c 100644
--- a/src/ui/client/ClipDetail.tsx
+++ b/src/ui/client/ClipDetail.tsx
@@ -68,6 +68,7 @@ export default function ClipDetail() {
const [bust, setBust] = useState(1);
const [davinciOn, setDavinciOn] = useState(false);
const [reframing, setReframing] = useState(false);
+ const [trimming, setTrimming] = useState(false);
const [logoPath, setLogoPath] = useState("");
const [logoPosition, setLogoPosition] = useState("top-right");
const [logoPreviews, setLogoPreviews] = useState<Array<{ position: string; path: string }>>([]);
@@ -280,7 +281,10 @@ export default function ClipDetail() {
<div className="clip-detail">
<div className="clip-detail-player">
{clip.output_path ? <ClipPlayer key={previewUrl} src={previewUrl} poster={posterUrl} onTime={(t) => (playerTime.current = t)} /> : <div className="phone-empty">No rendered output</div>}
- <button className="btn btn-ghost btn-sm" style={{ width: "100%", marginTop: 10 }} onClick={() => setReframing(true)}>Reframe (fix camera)</button>
+ <div style={{ display: "flex", gap: 8, marginTop: 10 }}>
+ <button className="btn btn-ghost btn-sm" style={{ flex: 1 }} onClick={() => setTrimming(true)}>Trim length</button>
+ <button className="btn btn-ghost btn-sm" style={{ flex: 1 }} onClick={() => setReframing(true)}>Reframe</button>
+ </div>
<div className="clip-meta">
<span>{fmt(clip.start_second)}-{fmt(clip.end_second)} · {clip.duration}s</span>
<span>{clip.crop_strategy}</span>
@@ -498,6 +502,17 @@ export default function ClipDetail() {
onDone={() => { setReframing(false); setBust(Date.now()); setMsg("Reframed & re-rendered"); setMsgErr(false); load(); }}
/>
)}
+ {trimming && (
+ <ReframeEditor
+ clipId={clip.id}
+ start={clip.start_second}
+ end={clip.end_second}
+ caption_style={clip.caption_style}
+ trimOnly
+ onClose={() => setTrimming(false)}
+ onDone={() => { setTrimming(false); setBust(Date.now()); setMsg("Trimmed & re-rendered"); setMsgErr(false); load(); }}
+ />
+ )}
</div>
);
}
diff --git a/src/ui/client/ReframeEditor.tsx b/src/ui/client/ReframeEditor.tsx
index 41bfa49..72ebbde 100644
--- a/src/ui/client/ReframeEditor.tsx
+++ b/src/ui/client/ReframeEditor.tsx
@@ -8,9 +8,10 @@ const FRAME = 1 / 30;
const BUFFER = 7; // seconds of padding shown around the clip for trimming
export default function ReframeEditor({
- clipId, start, end, caption_style, onClose, onDone,
+ clipId, start, end, caption_style, trimOnly = false, onClose, onDone,
}: {
clipId: string; start: number; end: number; caption_style: string;
+ trimOnly?: boolean;
onClose: () => void; onDone: () => void;
}) {
const videoRef = useRef<HTMLVideoElement>(null);
@@ -126,7 +127,9 @@ export default function ReframeEditor({
try {
const r = await api(`/clips/${clipId}/rerender`, {
method: "POST",
- body: JSON.stringify({ caption_style, reframe: { keyframes: kf, inSec: +inSec.toFixed(3), outSec: +outSec.toFixed(3) } }),
+ body: JSON.stringify(trimOnly
+ ? { caption_style, trim: { inSec: +inSec.toFixed(3), outSec: +outSec.toFixed(3) } }
+ : { caption_style, reframe: { keyframes: kf, inSec: +inSec.toFixed(3), outSec: +outSec.toFixed(3) } }),
});
if (r.error) throw new Error(r.error);
onDone();
@@ -137,14 +140,14 @@ export default function ReframeEditor({
<div className="reframe-overlay" onClick={onClose}>
<div className="reframe-modal" onClick={(e) => e.stopPropagation()}>
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 12 }}>
- <h3 style={{ margin: 0, fontSize: 16 }}>Reframe & trim</h3>
+ <h3 style={{ margin: 0, fontSize: 16 }}>{trimOnly ? "Trim length" : "Reframe & trim"}</h3>
<button className="btn btn-ghost btn-sm" onClick={onClose} aria-label="Close"><CloseIcon /></button>
</div>
- <div ref={stageRef} className="reframe-stage" onPointerDown={pointer} onPointerMove={pointer}>
+ <div ref={stageRef} className="reframe-stage" onPointerDown={trimOnly ? undefined : pointer} onPointerMove={trimOnly ? undefined : pointer}>
<video ref={videoRef} src={`/api/clips/${clipId}/source`} playsInline preload="auto"
onLoadedMetadata={onMeta} onTimeUpdate={onTimeUpdate} onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} />
- <div className="reframe-box" style={{ left: `${centerPct - half}%`, width: `${boxPct}%` }} />
+ {!trimOnly && <div className="reframe-box" style={{ left: `${centerPct - half}%`, width: `${boxPct}%` }} />}
</div>
<div ref={trackRef} className="rf-track" onPointerDown={onTrackDown} onPointerMove={(e) => { if (e.buttons) applyDrag(e.clientX); }} onPointerUp={() => (dragMode.current = null)}>
@@ -152,12 +155,12 @@ export default function ReframeEditor({
<div className="rf-handle rf-handle-in" style={{ left: `${pos(inSec)}%` }} />
<div className="rf-handle rf-handle-out" style={{ left: `${pos(outSec)}%` }} />
{cuts.map((c) => <div key={`cut-${c}`} className="rf-cut" style={{ left: `${pos(c)}%` }} title={`camera switch @ ${fmtMs(c)}`} />)}
- {keyframes.map((k) => <div key={k.tAbs} className="rf-kf" style={{ left: `${pos(k.tAbs)}%` }} title={`${fmtMs(k.tAbs)} · ${Math.round(k.x_pct)}%`} />)}
+ {!trimOnly && keyframes.map((k) => <div key={k.tAbs} className="rf-kf" style={{ left: `${pos(k.tAbs)}%` }} title={`${fmtMs(k.tAbs)} · ${Math.round(k.x_pct)}%`} />)}
<div className="rf-playhead" style={{ left: `${pos(tAbs)}%` }} />
</div>
<div className="hint" style={{ marginTop: 6 }}>
- {detectingCuts ? "Detecting camera switches…" : cuts.length ? `${cuts.length} camera switch${cuts.length > 1 ? "es" : ""} detected. A keyframe near one snaps to it.` : "No camera switches detected"}
+ {trimOnly ? "Drag the handles to extend or shorten. Face detection stays on." : detectingCuts ? "Detecting camera switches…" : cuts.length ? `${cuts.length} camera switch${cuts.length > 1 ? "es" : ""} detected. A keyframe near one snaps to it.` : "No camera switches detected"}
</div>
<div style={{ display: "flex", alignItems: "center", gap: 6, marginTop: 8 }}>
@@ -168,10 +171,10 @@ export default function ReframeEditor({
<button className="btn btn-ghost btn-sm" title="Next camera switch" onClick={() => jumpCut(1)} disabled={!cuts.length}><CutForwardIcon /></button>
<span style={{ fontSize: 12, color: "var(--text)", fontVariantNumeric: "tabular-nums", marginLeft: 4 }}>{fmtMs(tAbs)}</span>
<span style={{ flex: 1 }} />
- <button className="btn btn-primary btn-sm" onClick={addKeyframe}>+ Keyframe</button>
+ {!trimOnly && <button className="btn btn-primary btn-sm" onClick={addKeyframe}>+ Keyframe</button>}
</div>
- {keyframes.length > 0 && (
+ {!trimOnly && keyframes.length > 0 && (
<div style={{ display: "flex", flexWrap: "wrap", gap: 6, marginTop: 12 }}>
{keyframes.map((k) => (
<span key={k.tAbs} className="pill" style={{ fontSize: 11, display: "inline-flex", gap: 6, alignItems: "center", cursor: "pointer" }} onClick={() => seek(k.tAbs)}>
diff --git a/src/ui/web-server.ts b/src/ui/web-server.ts
index b83f183..835e528 100644
--- a/src/ui/web-server.ts
+++ b/src/ui/web-server.ts
@@ -3073,16 +3073,20 @@ app.post("/api/clips/:id/rerender", async (req, res) => {
// Editor sends source-absolute keyframes + trim; derive the render's clip-relative
// crop keyframes from it, and persist the editor state so reopening shows it.
const reframe = req.body?.reframe as { keyframes?: { tAbs: number; x_pct: number }[]; inSec?: number; outSec?: number } | undefined;
+ const trim = req.body?.trim as { inSec?: number; outSec?: number } | undefined;
const startSecond = reframe && typeof reframe.inSec === "number" ? reframe.inSec
+ : trim && typeof trim.inSec === "number" ? trim.inSec
: typeof req.body?.start_second === "number" ? req.body.start_second : clip.start_second;
const endSecond = reframe && typeof reframe.outSec === "number" ? reframe.outSec
+ : trim && typeof trim.outSec === "number" ? trim.outSec
: typeof req.body?.end_second === "number" ? req.body.end_second : clip.end_second;
const keyframes = reframe?.keyframes
? reframe.keyframes
.filter((k) => k.tAbs >= startSecond - 0.001 && k.tAbs <= endSecond + 0.001)
.map((k) => ({ t: +Math.max(0, k.tAbs - startSecond).toFixed(3), x_pct: k.x_pct }))
: req.body?.crop_keyframes;
- if (!Array.isArray(keyframes) || keyframes.length === 0) {
+ const trimOnly = !!trim && !reframe && !Array.isArray(keyframes);
+ if (!trimOnly && (!Array.isArray(keyframes) || keyframes.length === 0)) {
res.status(400).json({ error: "keyframes required" });
return;
}
@@ -3106,8 +3110,8 @@ app.post("/api/clips/:id/rerender", async (req, res) => {
start_second: startSecond,
end_second: endSecond,
caption_style: req.body?.caption_style || (recipe.caption_style as string) || clip.caption_style,
- crop_strategy: "manual",
- crop_keyframes: keyframes,
+ crop_strategy: trimOnly ? (recipe.crop_strategy as string) || clip.crop_strategy || "face" : "manual",
+ ...(trimOnly ? {} : { crop_keyframes: keyframes }),
transcript_words: words,
logo_path: (recipe.logo_path as string) ?? clip.logo_path ?? null,
outro_path: (recipe.outro_path as string) ?? clip.outro_path ?? null,
@@ -3135,10 +3139,11 @@ app.post("/api/clips/:id/rerender", async (req, res) => {
await clipsHistory.update(clip.id, {
start_second: startSecond,
end_second: endSecond,
- crop_strategy: "manual",
+ crop_strategy: trimOnly ? (recipe.crop_strategy as string) || clip.crop_strategy || "face" : "manual",
duration: result.data.duration ?? clip.duration,
file_size_mb: result.data.file_size_mb ?? clip.file_size_mb,
output_path: outPath,
+ ...(trimOnly ? { logo_backup_path: "" } : {}),
});
res.json({ ok: true, output_path: outPath, file_size_mb: result.data.file_size_mb, thumbnail_baked: thumbnailBaked });
} catch (e: any) {