Skip to content

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

Slide the name card in from the edge it sits on (#192)

Nika Siradze5c37e3c59d37
diff --git a/backend/cli.py b/backend/cli.py
index afdf698..f1ae6fb 100644
--- a/backend/cli.py
+++ b/backend/cli.py
@@ -477,6 +477,17 @@ def cmd_studio(args):
]
# Only when asked for, so a studio cut that names none of these is the
# same command it was before they existed.
+ # Declared on this command since name cards existed and never handed to the
+ # script that draws them, so every `studio --name-card` accepted the words
+ # and rendered a clip without them.
+ if getattr(args, "name_card", None):
+ cmd += ["--name-card", args.name_card]
+ if getattr(args, "name_card_sub", None):
+ cmd += ["--name-card-sub", args.name_card_sub]
+ if getattr(args, "name_card_seconds", None) is not None:
+ cmd += ["--name-card-seconds", str(args.name_card_seconds)]
+ if getattr(args, "name_card_accent", None):
+ cmd += ["--name-card-accent", args.name_card_accent]
if getattr(args, "no_captions", False):
cmd += ["--no-captions"]
if getattr(args, "topic", None):
@@ -4403,6 +4414,8 @@ def main():
help="Second line of the lower third")
studio.add_argument("--name-card-seconds", dest="name_card_seconds", type=float,
help="How long the lower third holds (default 3)")
+ studio.add_argument("--name-card-accent", dest="name_card_accent",
+ help="Colour of the rule under the lower third")
studio.add_argument("--motion", dest="motion",
help='How each part arrives and leaves, as JSON: '
'{"captions":{"enter":"rise","exit":"fade","duration":5,"feel":"soft"}}')
diff --git a/backend/clip_studio.py b/backend/clip_studio.py
index f30907e..8a12dd9 100644
--- a/backend/clip_studio.py
+++ b/backend/clip_studio.py
@@ -244,6 +244,16 @@ def main():
ap.add_argument("--logo", default=None, help="Logo image (asset name or path)")
ap.add_argument("--logo-position", default="top-left", choices=["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"])
ap.add_argument("--logo-scale", type=float, default=1.0)
+ # Read out of args since name cards existed, and never declared, so the
+ # launcher had nowhere to hand them even once it started trying.
+ ap.add_argument("--name-card", dest="name_card", default=None,
+ help="Lower third naming the speaker, shown for the first seconds")
+ ap.add_argument("--name-card-sub", dest="name_card_sub", default=None,
+ help="Second line of the lower third")
+ ap.add_argument("--name-card-seconds", dest="name_card_seconds", type=float,
+ default=None, help="How long the lower third holds")
+ ap.add_argument("--name-card-accent", dest="name_card_accent", default=None,
+ help="Colour of the rule under the lower third")
ap.add_argument("--no-captions", dest="no_captions", action="store_true",
help="Draw the overlay and burn no words")
ap.add_argument("--topic", default=None,
@@ -337,7 +347,9 @@ def main():
"title": args.name_card,
"subtitle": getattr(args, "name_card_sub", None),
"seconds": getattr(args, "name_card_seconds", None),
- "accent": accent,
+ # The card's own rule, when one was named. Falls back to the
+ # show's accent, which is what it has always used.
+ "accent": getattr(args, "name_card_accent", None) or accent,
}
motion = None
diff --git a/backend/services/clip_generator.py b/backend/services/clip_generator.py
index 017eaeb..e212fb2 100644
--- a/backend/services/clip_generator.py
+++ b/backend/services/clip_generator.py
@@ -1022,20 +1022,20 @@ def generate_clip(
else:
fit_to_frame(segment_path, cropped_path, target_dims=spec.dims)
- # Only Remotion draws the name card, and it is reached only when there
- # are words to caption. Refusing beats returning a clip that quietly
- # lacks the overlay that was asked for.
- if name_card and name_card.get("title"):
- if use_ass_captions or allow_ass_fallback:
- raise ValueError(
- "A name card can only be drawn by the Remotion renderer. "
- "Drop --name-card, or drop --fast and --allow-ass-fallback."
- )
- if not transcript_words:
- raise ValueError(
- "A name card needs the caption renderer, which only runs when "
- "there is a transcript. Drop --name-card for an uncaptioned render."
- )
+ # Only Remotion draws the name card, and --fast forces the ASS renderer,
+ # which cannot. Refusing beats returning a clip that quietly lacks the
+ # overlay that was asked for.
+ #
+ # Permitting the fallback is no longer a reason to refuse: a card is an
+ # overlay, the pass that draws it runs for overlays whether or not there
+ # are words to caption, and a failure there raises rather than handing
+ # back a bare cut. Refusing on the permission alone meant every `studio`
+ # render, which always permits it, could never draw one.
+ if name_card and name_card.get("title") and use_ass_captions:
+ raise ValueError(
+ "A name card is drawn by the Remotion renderer, and --fast forces "
+ "the ASS one. Drop --name-card, or drop --fast."
+ )
# Step 3: Render captions (Remotion-first; ASS fallback optional)
#
diff --git a/cli/VERSION b/cli/VERSION
index f1ffbeb..c41882c 100644
--- a/cli/VERSION
+++ b/cli/VERSION
@@ -1 +1 @@
-2.7.19
+2.7.20
diff --git a/package-lock.json b/package-lock.json
index a065ee6..1b0eb7a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "podcli",
- "version": "2.7.19",
+ "version": "2.7.20",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "podcli",
- "version": "2.7.19",
+ "version": "2.7.20",
"license": "AGPL-3.0-only",
"dependencies": {
"@fontsource/dm-sans": "^5.3.0",
diff --git a/package.json b/package.json
index 65184c8..4df4c72 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "podcli",
- "version": "2.7.19",
+ "version": "2.7.20",
"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/remotion/src/components/NameCard.tsx b/remotion/src/components/NameCard.tsx
index 9dcdfa0..798d55b 100644
--- a/remotion/src/components/NameCard.tsx
+++ b/remotion/src/components/NameCard.tsx
@@ -41,7 +41,7 @@ export const NameCard: React.FC<NameCardProps> = ({
if (!title) return null;
- const { opacity, shift } = motionAt({
+ const { opacity, shift, slide } = motionAt({
frame, fps, start: 0, end: seconds,
motion: motion ?? MOTION.nameCard,
scale: 12 * s,
@@ -59,9 +59,15 @@ export const NameCard: React.FC<NameCardProps> = ({
background,
borderBottom: `${10 * s}px solid ${accent}`,
opacity,
- // Rises the last few pixels as it arrives, which reads as arriving
- // rather than appearing.
- transform: `translateY(${shift}px)`,
+ /*
+ * In from the edge it is anchored to, then the last few pixels up.
+ *
+ * The horizontal travel is a percentage of the card's own width, which
+ * is the only measure that has it entirely off screen at every
+ * composition size. Both are identity under a motion that says
+ * neither, so a card told to rise still only rises.
+ */
+ transform: `translateX(${slide * 100}%) translateY(${shift}px)`,
}}
>
<div
diff --git a/remotion/src/motion.ts b/remotion/src/motion.ts
index cd63815..e82392d 100644
--- a/remotion/src/motion.ts
+++ b/remotion/src/motion.ts
@@ -12,7 +12,7 @@ import { interpolate, spring } from "remotion";
* nothing renders exactly what it rendered before.
*/
export type Motion = {
- enter: "none" | "fade" | "rise" | "pop";
+ enter: "none" | "fade" | "rise" | "pop" | "slide";
exit: "none" | "fade" | "sink";
/** Frames at the composition's fps, for the fading half of the move. */
duration: number;
@@ -35,8 +35,14 @@ export const MOTION: Record<string, Motion> = {
karaoke: { enter: "none", exit: "none", duration: 0, feel: "linear" },
/** The pill on the active word is the motion; the block holds still. */
branded: { enter: "none", exit: "none", duration: 0, feel: "linear" },
- /** Names arrive, hold, and get out of the way. */
- nameCard: { enter: "rise", exit: "fade", duration: 8, feel: "soft" },
+ /**
+ * Names arrive, hold, and get out of the way.
+ *
+ * In from the edge rather than up from nothing: a lower third that slides is
+ * the move every broadcast makes, and it reads as a card being placed rather
+ * than as a caption that faded up in the wrong place.
+ */
+ nameCard: { enter: "slide", exit: "fade", duration: 8, feel: "soft" },
/**
* A card takes the frame, so it has to arrive quickly enough not to read as
* a slow wipe and leave without a gap where neither it nor the video is up.
@@ -105,7 +111,7 @@ export function motionAt({
motion: Motion;
/** How far a rise or a sink travels, already scaled to the canvas. */
scale?: number;
-}): { opacity: number; scale: number; shift: number } {
+}): { opacity: number; scale: number; shift: number; slide: number } {
const startFrame = Math.round(start * fps);
const since = frame - startFrame;
@@ -134,5 +140,21 @@ export function motionAt({
})
: 0;
- return { opacity, scale, shift: entering + leaving };
+ /*
+ * How far in from its own edge a sliding part still is, as a fraction of its
+ * own width: -1 is entirely off, 0 is home.
+ *
+ * A fraction rather than pixels because the part knows its width and this
+ * does not, and an element anchored to an edge is only reliably off screen
+ * when it has been moved by its whole width. The caller turns it into a
+ * percentage translate, which stays right at any composition size.
+ */
+ const slide = motion.enter === "slide"
+ ? interpolate(since, [0, motion.duration + 1], [-1, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ })
+ : 0;
+
+ return { opacity, scale, shift: entering + leaving, slide };
}