Skip to content

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

feat: mouth-motion reframe, smarter clip boundaries, web UI live preview, thumbnail opt-in

Nika Siradzea58e68880feb
diff --git a/backend/cli.py b/backend/cli.py
index a08cd1a..995b31f 100644
--- a/backend/cli.py
+++ b/backend/cli.py
@@ -13,6 +13,7 @@ One-command processing:
import argparse
import json
import os
+import shutil
# Load .env file (for HF_TOKEN, etc.)
try:
@@ -292,7 +293,7 @@ def cmd_process(args):
config["energy_boost"] = False
config["no_speakers"] = True
config["quality"] = args.quality or "low"
- config["crop_strategy"] = args.crop or "center"
+ config["crop_strategy"] = args.crop or "face"
config["allow_ass_fallback"] = True
config["use_ass_captions"] = True
config["generate_thumbnails"] = False
@@ -525,9 +526,21 @@ def cmd_process(args):
# ── Step 4: Export ──
# Check if thumbnail generation is enabled
thumb_dir = os.path.join(output_dir, "thumbnails")
- _thumb_enabled = bool(config.get("generate_thumbnails", True))
_thumb_intro_duration = 0.8
_tc_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".podcli", "thumbnail-config.json")
+
+ # Opt-in: a brand config must exist before podcli generates thumbnails.
+ # New users get no auto-thumbnails until they run `podcli init-thumbnail`
+ # (or write their own .podcli/thumbnail-config.json). Existing users who
+ # already have the file keep working - the file is the opt-in signal.
+ # An explicit `generate_thumbnails` flag in the runtime config still
+ # overrides either way for scripted runs.
+ _explicit = config.get("generate_thumbnails")
+ if _explicit is not None:
+ _thumb_enabled = bool(_explicit)
+ else:
+ _thumb_enabled = os.path.exists(_tc_path)
+
if _thumb_enabled and os.path.exists(_tc_path):
try:
with open(_tc_path) as _tcf:
@@ -580,7 +593,7 @@ def cmd_process(args):
start_second=clip["start_second"],
end_second=clip["end_second"],
caption_style=config.get("caption_style", "branded"),
- crop_strategy=config.get("crop_strategy", "speaker"),
+ crop_strategy=config.get("crop_strategy", "face"),
transcript_words=words,
title=clip.get("title", f"clip_{i+1}"),
output_dir=output_dir,
@@ -793,7 +806,7 @@ def cmd_process(args):
start_second=clip["start_second"],
end_second=clip["end_second"],
caption_style=config.get("caption_style", "branded"),
- crop_strategy=config.get("crop_strategy", "speaker"),
+ crop_strategy=config.get("crop_strategy", "face"),
transcript_words=words,
title=clip.get("title", f"clip_{i+1}"),
output_dir=output_dir,
@@ -1251,7 +1264,7 @@ def _post_render_loop(
start_second=clip["start_second"],
end_second=clip["end_second"],
caption_style=config.get("caption_style", "branded"),
- crop_strategy=config.get("crop_strategy", "speaker"),
+ crop_strategy=config.get("crop_strategy", "face"),
transcript_words=words,
title=clip.get("title", "clip"),
output_dir=output_dir,
@@ -1436,7 +1449,7 @@ def _post_render_loop(
start_second=f_clip["start_second"],
end_second=f_clip["end_second"],
caption_style=config.get("caption_style", "branded"),
- crop_strategy=config.get("crop_strategy", "speaker"),
+ crop_strategy=config.get("crop_strategy", "face"),
transcript_words=words,
title=f_clip.get("title", "clip"),
output_dir=output_dir,
@@ -1490,7 +1503,7 @@ def _post_render_loop(
start_second=nc["start_second"],
end_second=nc["end_second"],
caption_style=config.get("caption_style", "branded"),
- crop_strategy=config.get("crop_strategy", "speaker"),
+ crop_strategy=config.get("crop_strategy", "face"),
transcript_words=words,
title=nc.get("title", "clip"),
output_dir=output_dir,
@@ -1953,6 +1966,54 @@ def cmd_assets(args):
sys.exit(1)
+def cmd_init_thumbnail(args):
+ """Scaffold .podcli/thumbnail-config.json from the example template.
+
+ Opting in to thumbnail generation means having this file exist. Until
+ then podcli skips the thumbnail step entirely (see crop_to_vertical
+ in cli.py (opt-in is gated on file existence).
+ """
+ accent = "\033[38;2;212;135;74m"
+ green = "\033[38;2;74;222;128m"
+ yellow = "\033[38;2;250;204;21m"
+ gray = "\033[38;5;245m"
+ bold = "\033[1m"
+ reset = "\033[0m"
+
+ repo_root = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
+ example_path = os.path.abspath(os.path.join(repo_root, "docs", "thumbnail-config.example.json"))
+ target_dir = os.path.abspath(os.path.join(repo_root, ".podcli"))
+ target_path = os.path.join(target_dir, "thumbnail-config.json")
+
+ if not os.path.exists(example_path):
+ print(
+ f"\n {yellow}✗ Missing {example_path}{reset}\n"
+ f" {gray}Reinstall or pull latest from the repo.{reset}\n",
+ file=sys.stderr,
+ )
+ sys.exit(1)
+
+ if os.path.exists(target_path) and not getattr(args, "force", False):
+ print(
+ f"\n {yellow}⚠ {target_path} already exists.{reset}\n"
+ f" {gray}Re-run with --force to overwrite, or edit the file directly.{reset}\n"
+ )
+ sys.exit(2)
+
+ os.makedirs(target_dir, exist_ok=True)
+ shutil.copyfile(example_path, target_path)
+
+ print(
+ f"\n {green}✓ Wrote{reset} {bold}{target_path}{reset}\n"
+ f" {gray}Next:{reset}\n"
+ f" 1. Open it and change {accent}bg_color{reset} / {accent}text_color{reset} / {accent}accent_color{reset} to your brand.\n"
+ f" 2. Tune {accent}line1_*{reset} / {accent}line2_*{reset} font sizes if needed.\n"
+ f" 3. Run {accent}podcli thumbnails \"Your test title\"{reset} to preview.\n"
+ f" {gray}While this file exists, podcli auto-generates thumbnails on every clip.{reset}\n"
+ f" {gray}Delete it (or set enabled: false) to disable.{reset}\n"
+ )
+
+
def cmd_thumbnails(args):
"""Generate thumbnail variations for a title."""
from services.thumbnail_ai import generate_variations
@@ -2697,6 +2758,16 @@ def main():
# ── info ──
sub.add_parser("info", help="Show system info (encoder, etc.)")
+ init_thumb = sub.add_parser(
+ "init-thumbnail",
+ help="Scaffold .podcli/thumbnail-config.json so podcli generates thumbnails for you",
+ )
+ init_thumb.add_argument(
+ "--force",
+ action="store_true",
+ help="Overwrite an existing .podcli/thumbnail-config.json",
+ )
+
args = parser.parse_args()
if getattr(args, "show_help", False) and args.command is None:
@@ -2723,6 +2794,8 @@ def main():
cmd_cache(args)
elif args.command == "info":
cmd_info(args)
+ elif args.command == "init-thumbnail":
+ cmd_init_thumbnail(args)
else:
interactive_menu()
@@ -3389,7 +3462,7 @@ def _interactive_presets():
crop = questionary.select(
"Crop strategy:",
choices=["speaker", "face", "center"],
- default=config.get("crop_strategy", "speaker"),
+ default=config.get("crop_strategy", "face"),
style=qstyle,
).ask()
if crop:
diff --git a/backend/presets.py b/backend/presets.py
index efd6d75..f7cbb87 100644
--- a/backend/presets.py
+++ b/backend/presets.py
@@ -28,7 +28,7 @@ TARGET_CLIP_DURATION_MAX = 35 # Claude targets this range
DEFAULT_PRESET = {
"caption_style": "branded",
- "crop_strategy": "speaker",
+ "crop_strategy": "face",
"time_adjust": -1.0,
"logo_path": "",
"outro_path": "",
diff --git a/backend/services/clip_generator.py b/backend/services/clip_generator.py
index d752da8..626b4ba 100644
--- a/backend/services/clip_generator.py
+++ b/backend/services/clip_generator.py
@@ -29,10 +29,12 @@ from services.video_processor import (
from config.caption_styles import get_style
from presets import MAX_CLIP_DURATION
-# Filler words to strip from captions (not aggressive — just obvious fillers)
_FILLER_WORDS = frozenset([
"um", "uh", "uhh", "uhm", "umm", "hmm", "hm", "mhm",
"ah", "er", "erm", "eh",
+ "ummm", "ummmm", "ummmmm", "uhhh", "uhhhh", "uhhhhh",
+ "hmmm", "hmmmm", "uhmm", "uhmmm",
+ "mmm", "mmmm", "mhmm", "mmhm",
])
# Weak lead-in markers that often add setup without adding viral value.
@@ -266,39 +268,33 @@ def _snap_to_sentence_end(
transcript_words: list[dict], start_second: float, end_second: float,
max_extension: float = 3.0,
) -> float:
- """
- Snap clip end_second to the nearest sentence boundary (. ! ?).
- Searches forward up to max_extension seconds. If no boundary found,
- searches backward within the clip. Returns adjusted end_second.
+ """Snap clip end_second forward to the nearest sentence boundary.
+
+ Forward-only. Stops at speaker changes to avoid bleeding into a reply.
"""
SENTENCE_ENDINGS = ".!?"
- # Get the last word in the clip range
clip_words = [w for w in transcript_words if w["end"] > start_second and w["start"] < end_second]
if not clip_words:
return end_second
last_clip_word = clip_words[-1]
last_word_text = last_clip_word.get("word", "").strip()
+ last_speaker = last_clip_word.get("speaker")
- # Already ends on a sentence boundary — extend to include full word
if last_word_text and last_word_text[-1] in SENTENCE_ENDINGS:
return max(end_second, last_clip_word["end"])
- # Search forward: find next sentence-ending word within max_extension
for w in sorted(transcript_words, key=lambda x: x["start"]):
- if w["start"] >= last_clip_word["end"] and w["end"] <= end_second + max_extension:
- text = w.get("word", "").strip()
- if text and text[-1] in SENTENCE_ENDINGS:
- return w["end"]
-
- # Search backward: find last sentence-ending word within the clip
- for w in reversed(clip_words):
+ if w["start"] < last_clip_word["end"]:
+ continue
+ if w["end"] > end_second + max_extension:
+ break
+ if last_speaker is not None and w.get("speaker") is not None and w.get("speaker") != last_speaker:
+ break
text = w.get("word", "").strip()
if text and text[-1] in SENTENCE_ENDINGS:
- # Only snap backward if we don't lose more than 30% of the clip
- if w["end"] > start_second + (end_second - start_second) * 0.7:
- return w["end"]
+ return w["end"]
return end_second
@@ -326,7 +322,7 @@ def _build_tight_segments(
words: list[dict],
start_second: float,
end_second: float,
- silence_threshold: float = 0.8,
+ silence_threshold: float = 0.55,
) -> list[dict]:
"""
Build tight keep-segments from transcript words, cutting out:
@@ -563,6 +559,7 @@ def generate_clip(
outro_path: Optional[str] = None,
clean_fillers: bool = True,
keep_segments: list[dict] = None,
+ trim_opening: Optional[bool] = None,
allow_ass_fallback: bool = False,
use_ass_captions: bool = False,
progress_callback: Optional[Callable[[int, str], None]] = None,
@@ -596,6 +593,15 @@ def generate_clip(
if end_second <= start_second:
raise ValueError("end_second must be greater than start_second")
+ if trim_opening is None:
+ trim_opening = not (keep_segments and len(keep_segments) > 0)
+
+ llm_start_second, llm_end_second = start_second, end_second
+ if keep_segments and len(keep_segments) > 0:
+ llm_start_second = keep_segments[0]["start"]
+ llm_end_second = keep_segments[-1]["end"]
+ llm_total = max(0.01, llm_end_second - llm_start_second)
+
# Multi-segment cutting: if keep_segments provided, use those ranges.
# Otherwise auto-detect silences/fillers and build tight segments.
if keep_segments and len(keep_segments) > 0:
@@ -603,8 +609,7 @@ def generate_clip(
keep_segments = [s for s in keep_segments if s["end"] > s["start"]]
keep_segments.sort(key=lambda s: s["start"])
- # Tighten the opening of the first kept segment to reduce setup/preamble.
- if transcript_words:
+ if trim_opening and transcript_words:
trimmed_start = _trim_weak_opening(
transcript_words,
keep_segments[0]["start"],
@@ -613,6 +618,15 @@ def generate_clip(
if trimmed_start < keep_segments[0]["end"] - 0.5:
keep_segments[0]["start"] = trimmed_start
+ if transcript_words:
+ snapped_end = _snap_to_sentence_end(
+ transcript_words,
+ keep_segments[-1]["start"],
+ keep_segments[-1]["end"],
+ )
+ if snapped_end > keep_segments[-1]["end"]:
+ keep_segments[-1]["end"] = snapped_end
+
start_second = keep_segments[0]["start"]
end_second = keep_segments[-1]["end"]
@@ -627,11 +641,9 @@ def generate_clip(
duration = sum(s["end"] - s["start"] for s in keep_segments)
else:
- # Tighten weak setup at the head before sentence/end trimming.
- if transcript_words:
+ if trim_opening and transcript_words:
start_second = _trim_weak_opening(transcript_words, start_second, end_second)
- # Snap clip boundaries to sentence endings
if transcript_words:
end_second = _snap_to_sentence_end(transcript_words, start_second, end_second)
@@ -650,6 +662,17 @@ def generate_clip(
keep_segments = None
duration = end_second - start_second
+ if duration < 0.75 * llm_total and llm_total >= 8.0:
+ print(
+ f" Boundary revert: post-trim duration {duration:.1f}s < "
+ f"75% of asked {llm_total:.1f}s - using original range",
+ flush=True,
+ )
+ start_second = llm_start_second
+ end_second = llm_end_second
+ keep_segments = None
+ duration = end_second - start_second
+
if duration > MAX_CLIP_DURATION:
raise ValueError(f"Clip too long ({duration:.0f}s). Max {MAX_CLIP_DURATION} seconds for shorts.")
diff --git a/backend/services/local_reframe.py b/backend/services/local_reframe.py
new file mode 100644
index 0000000..9a66728
--- /dev/null
+++ b/backend/services/local_reframe.py
@@ -0,0 +1,350 @@
+"""Per-clip mouth-motion reframe planner."""
+
+from __future__ import annotations
+
+import logging
+import os
+import re
+import tempfile
+from pathlib import Path
+from typing import Optional
+
+from utils.proc import run as proc_run, ProcError
+
+log = logging.getLogger("podcli.local_reframe")
+
+
+_PTS_RE = re.compile(r"pts_time:([0-9.]+)")
+_YAVG_RE = re.compile(r"lavfi\.signalstats\.YAVG=([0-9.]+)")
+
+
+def count_scene_cuts(video_path: str, threshold: float = 0.35) -> int:
+ """Count scene cuts in the clip via FFmpeg's `select='gt(scene,...)'` filter.
+
+ Returns the number of detected cuts. Returns 0 if FFmpeg fails - callers
+ should treat 0 as "no info" and proceed with their default plan.
+ """
+ try:
+ result = proc_run(
+ [
+ "ffmpeg",
+ "-i", str(video_path),
+ "-filter:v", f"select='gt(scene,{threshold})',showinfo",
+ "-f", "null", "-",
+ ],
+ timeout=180,
+ check=False,
+ )
+ except ProcError as exc:
+ log.warning("scene-cut count failed: %s", exc)
+ return 0
+ if result.returncode != 0:
+ return 0
+ return len(_PTS_RE.findall(result.stderr or ""))
+
+
+def parse_motion_metadata(path: Path) -> tuple[list[float], list[float]]:
+ """Parse FFmpeg metadata-print output into (times, YAVG values) lists."""
+ times: list[float] = []
+ values: list[float] = []
+ current_time: Optional[float] = None
+ try:
+ raw = path.read_text(errors="ignore")
+ except OSError:
+ return [], []
+ for line in raw.splitlines():
+ pts_match = _PTS_RE.search(line)
+ if pts_match:
+ current_time = float(pts_match.group(1))
+ continue
+ val_match = _YAVG_RE.search(line)
+ if val_match and current_time is not None:
+ times.append(current_time)
+ values.append(float(val_match.group(1)))
+ current_time = None
+ return times, values
+
+
+def smooth_values(values: list[float], window: int = 15) -> list[float]:
+ """Box-filter smoothing, no scipy dependency."""
+ if not values:
+ return []
+ half = window // 2
+ smoothed: list[float] = []
+ n = len(values)
+ for i in range(n):
+ lo = max(0, i - half)
+ hi = min(n, i + half + 1)
+ smoothed.append(sum(values[lo:hi]) / (hi - lo))
+ return smoothed
+
+
+def build_speaker_timeline_from_motion(
+ times: list[float],
+ left_values: list[float],
+ right_values: list[float],
+ min_duration: float = 1.0,
+ margin: float = 1.15,
+) -> list[dict]:
+ """Build a list of {start, end, speaker: "left"|"right"} segments.
+
+ Inputs are per-frame YAVG motion values for the two mouth ROIs. We
+ normalize each side by its own mean (so we compare *relative* activity,
+ not absolute brightness), smooth with a box filter, then walk the
+ timeline with hysteresis: only flip the active speaker when the other
+ side's smoothed motion exceeds the current side by `margin`x. Finally
+ merge segments shorter than `min_duration` into their neighbors so a
+ half-second laugh from the listener doesn't yank the camera.
+ """
+ if not times or len(left_values) != len(right_values) or not left_values:
+ return []
+ n = min(len(times), len(left_values), len(right_values))
+ times = times[:n]
+ left_values = left_values[:n]
+ right_values = right_values[:n]
+
+ def _normalize(values: list[float]) -> list[float]:
+ mean_value = sum(values) / max(len(values), 1)
+ if mean_value <= 0:
+ return [0.0] * len(values)
+ return [v / mean_value for v in values]
+
+ left = smooth_values(_normalize(left_values))
+ right = smooth_values(_normalize(right_values))
+ if not left or not right:
+ return []
+
+ current = 0 if left[0] >= right[0] else 1
+ states: list[int] = []
+ for lv, rv in zip(left, right):
+ if current == 0 and rv > lv * margin:
+ current = 1
+ elif current == 1 and lv > rv * margin:
+ current = 0
+ states.append(current)
+
+ segments: list[dict] = []
+ i = 0
+ while i < len(states):
+ j = i
+ while j + 1 < len(states) and states[j + 1] == states[i]:
+ j += 1
+ seg_start = times[i]
+ seg_end = times[min(j + 1, len(times) - 1)]
+ if seg_end <= seg_start:
+ seg_end = seg_start + 0.05
+ segments.append({
+ "start": seg_start,
+ "end": seg_end,
+ "speaker": "left" if states[i] == 0 else "right",
+ })
+ i = j + 1
+
+ merged: list[dict] = []
+ for seg in segments:
+ too_short = (seg["end"] - seg["start"]) < min_duration
+ if merged and (too_short or merged[-1]["speaker"] == seg["speaker"]):
+ merged[-1]["end"] = seg["end"]
+ continue
+ merged.append(dict(seg))
+ return merged
+
+
+def build_pan_x_expression(timeline: list[dict], left_x: int, right_x: int) -> str:
+ """Compile the speaker timeline into one nested if(lt(t,...)) expression.
+
+ The expression is evaluated by FFmpeg's crop filter per-frame, so the
+ crop window snaps to the active speaker without keyframe interpolation.
+ No animation by design. Smooth pans on speaker switches produce a
+ "drunken cameraman" effect on split-screen footage; hard cuts read as
+ intentional editing.
+ """
+ if not timeline:
+ return str(left_x)
+
+ def x_for(speaker: str) -> int:
+ return left_x if speaker == "left" else right_x
+
+ expr = str(x_for(timeline[-1]["speaker"]))
+ for seg in reversed(timeline[:-1]):
+ # Escape commas so the expression is safe inside a filtergraph.
+ expr = (
+ f"if(lt(t\\,{seg['end']:.4f})\\,{x_for(seg['speaker'])}\\,{expr})"
+ )
+ return expr
+
+
+def _safe_clip(value: int, lo: int, hi: int) -> int:
+ return max(lo, min(int(value), hi))
+
+
+def _even(value: int) -> int:
+ return value - (value % 2)
+
+
+def detect_local_speaker_reframe_plan(
+ clip_path: str,
+ face_map: dict,
+ target_ratio: float = 9 / 16,
+ max_scene_cuts: int = 2,
+ motion_timeout: float = 120.0,
+) -> Optional[dict]:
+ """Plan a per-clip pan based on local mouth motion.
+
+ Returns:
+ {
+ "mode": "pan",
+ "width": int, "height": int,
+ "crop_w": int, "crop_h": int,
+ "left_x": int, "right_x": int,
+ "x_expression": str, # ready to drop into ffmpeg crop=...:x='...'
+ "timeline": [...],
+ "scene_cuts": int,
+ }
+ or None when the plan doesn't apply (not split-screen, too many cuts,
+ motion analysis failed, single-side timeline).
+
+ The caller is responsible for falling back to the existing reframe
+ pipeline when this returns None.
+ """
+ if not face_map:
+ return None
+ clusters = face_map.get("clusters") or []
+ if len(clusters) < 2 or not face_map.get("is_split_screen"):
+ return None
+
+ width = int(face_map.get("video_width") or 0)
+ height = int(face_map.get("video_height") or 0)
+ if width <= 0 or height <= 0:
+ return None
+
+ if width / max(height, 1) <= 1.2:
+ return None
+
+ cuts = count_scene_cuts(clip_path)
+ if cuts > max_scene_cuts:
+ log.info("local-reframe skip: %d scene cuts in clip", cuts)
+ return None
+
+ left_cluster, right_cluster = clusters[0], clusters[1]
+ left_cx = int(left_cluster.get("center_x", width // 4))
+ right_cx = int(right_cluster.get("center_x", 3 * width // 4))
+ if abs(right_cx - left_cx) < width * 0.15:
+ return None
+
+ # PIP guard: a face ratio over 3x usually means inset, not split-screen.
+ obs = face_map.get("observations") or []
+ def _mean_face_w_for(side_cx: int) -> float:
+ widths = [
+ float(o.get("face_width") or 0)
+ for o in obs
+ if abs(int(o.get("face_center_x", 0)) - side_cx) < width * 0.15
+ and o.get("face_width")
+ ]
+ return sum(widths) / len(widths) if widths else 0.0
+
+ left_w = _mean_face_w_for(left_cx)
+ right_w = _mean_face_w_for(right_cx)
+ if left_w > 0 and right_w > 0:
+ ratio = max(left_w, right_w) / max(1.0, min(left_w, right_w))
+ if ratio > 3.0:
+ log.info(
+ "local-reframe skip: face-size ratio %.1f looks like PIP",
+ ratio,
+ )
+ return None
+
+ crop_w = _even(min(width, int(height * target_ratio)))
+ crop_h = _even(height)
+ max_x = max(0, width - crop_w)
+ left_x = _safe_clip(left_cx - crop_w // 2, 0, max_x)
+ right_x = _safe_clip(right_cx - crop_w // 2, 0, max_x)
+
+ def _mouth_roi(cluster: dict, side_cx: int) -> tuple[int, int, int, int]:
+ approx_face_w = 0
+ observations = face_map.get("observations") or []
+ side_obs = [
+ o for o in observations
+ if abs(int(o.get("face_center_x", 0)) - side_cx) < width * 0.15
+ ]
+ if side_obs:
+ approx_face_w = int(
+ sum(o.get("face_width", 0) for o in side_obs) / len(side_obs)
+ )
+ if approx_face_w < 60:
+ approx_face_w = max(80, width // 8)
+ cy_values = [o.get("face_center_y", height // 2) for o in side_obs]
+ cy = int(sum(cy_values) / len(cy_values)) if cy_values else height // 2
+ roi_w = _even(max(80, int(approx_face_w * 1.2)))
+ roi_h = _even(max(70, int(approx_face_w * 0.85)))
+ roi_x = _safe_clip(side_cx - roi_w // 2, 0, max(0, width - roi_w))
+ roi_y = _safe_clip(cy, 0, max(0, height - roi_h))
+ return roi_x, roi_y, roi_w, roi_h
+
+ lx, ly, lw, lh = _mouth_roi(left_cluster, left_cx)
+ rx, ry, rw, rh = _mouth_roi(right_cluster, right_cx)
+
+ with tempfile.TemporaryDirectory(prefix="podcli_reframe_") as tmp:
+ left_motion = Path(tmp) / "left.txt"
+ right_motion = Path(tmp) / "right.txt"
+ filter_complex = (
+ f"[0:v]split=2[l][r];"
+ f"[l]crop={lw}:{lh}:{lx}:{ly},format=gray,"
+ f"tblend=all_mode=difference,signalstats,"
+ f"metadata=mode=print:key=lavfi.signalstats.YAVG"
+ f":file={_escape_path_for_filter(left_motion)}[lo];"
+ f"[r]crop={rw}:{rh}:{rx}:{ry},format=gray,"
+ f"tblend=all_mode=difference,signalstats,"
+ f"metadata=mode=print:key=lavfi.signalstats.YAVG"
+ f":file={_escape_path_for_filter(right_motion)}[ro]"
+ )
+ try:
+ proc_run(
+ [
+ "ffmpeg", "-y",
+ "-i", str(clip_path),
+ "-filter_complex", filter_complex,
+ "-map", "[lo]", "-f", "null", "-",
+ "-map", "[ro]", "-f", "null", "-",
+ ],
+ timeout=motion_timeout,
+ check=False,
+ )
+ except ProcError as exc:
+ log.warning("local-reframe motion ffmpeg failed: %s", exc)
+ return None
+
+ if not left_motion.exists() or not right_motion.exists():
+ return None
+ times, left_values = parse_motion_metadata(left_motion)
+ _, right_values = parse_motion_metadata(right_motion)
+
+ timeline = build_speaker_timeline_from_motion(times, left_values, right_values)
+ if len(timeline) < 2:
+ return None
+
+ x_expression = build_pan_x_expression(timeline, left_x, right_x)
+
+ return {
+ "mode": "pan",
+ "width": width,
+ "height": height,
+ "crop_w": crop_w,
+ "crop_h": crop_h,
+ "left_x": left_x,
+ "right_x": right_x,
+ "x_expression": x_expression,
+ "timeline": timeline,
+ "scene_cuts": cuts,
+ }
+
+
+def _escape_path_for_filter(path: Path) -> str:
+ """Escape a filesystem path for use inside an FFmpeg filter argument."""
+ return (
+ str(path)
+ .replace("\\", "\\\\")
+ .replace(":", "\\:")
+ .replace("'", "\\'")
+ .replace(" ", "\\ ")
+ )
diff --git a/backend/services/thumbnail_generator.py b/backend/services/thumbnail_generator.py
index 049029d..64539c4 100644
--- a/backend/services/thumbnail_generator.py
+++ b/backend/services/thumbnail_generator.py
@@ -26,13 +26,18 @@ except ImportError:
# ── Default config (overridden by .podcli/thumbnail-config.json) ──
DEFAULT_CONFIG = {
+ # These defaults are intentionally a plain black/white placeholder.
+ # The "real" look comes from the user's `.podcli/thumbnail-config.json`,
+ # which they create by running `podcli init-thumbnail` (or by copying
+ # `docs/thumbnail-config.example.json`). If you see white-bg / black-
+ # text thumbnails you forgot to create your config - that's by design.
"width": 1080,
"height": 1920,
- # Colors — change these to match your brand
- "bg_color": "#1A1A1A",
- "text_color": "#FFFFFF",
- "accent_color": "#00CED1",
+ # Colors - placeholder palette. Override in your brand config.
+ "bg_color": "#FFFFFF",
+ "text_color": "#000000",
+ "accent_color": "#000000",
# Text
"font_size_line1": 80,
diff --git a/backend/services/thumbnail_html.py b/backend/services/thumbnail_html.py
index e10a502..5adaa3f 100644
--- a/backend/services/thumbnail_html.py
+++ b/backend/services/thumbnail_html.py
@@ -40,10 +40,12 @@ def _load_config() -> dict:
"width": 1080,
"height": 1920,
- # Colors
- "bg_color": "#1A1A2E",
- "text_color": "#FFFFFF",
- "accent_color": "#E94560",
+ # Colors - placeholder palette. Override in your brand config
+ # at `.podcli/thumbnail-config.json` (run `podcli init-thumbnail`
+ # to scaffold one).
+ "bg_color": "#FFFFFF",
+ "text_color": "#000000",
+ "accent_color": "#000000",
# Frame border (around entire thumbnail)
"frame_border_width": 3,
@@ -57,7 +59,7 @@ def _load_config() -> dict:
"box_min_height": "180px",
"box_border_width": 3,
"box_border_color": None, # None = accent
- "box_fill_color": "rgba(26,26,46,0.90)",
+ "box_fill_color": "rgba(255,255,255,0.92)",
"box_padding": "24px 32px",
# Line 1 (top line — typically white text)
@@ -67,7 +69,7 @@ def _load_config() -> dict:
"line1_line_height": 1.15,
"line1_margin_bottom": "8px",
"line1_uppercase": True,
- "line1_color": "#FFFFFF",
+ "line1_color": "#000000",
"line1_nowrap": True,
# Line 2 (bottom line — highlighted)
@@ -78,7 +80,7 @@ def _load_config() -> dict:
"line2_line_height": 1.15,
"line2_uppercase": True,
"line2_highlight_color": None, # None = accent
- "line2_text_color": "#1A1A2E",
+ "line2_text_color": "#FFFFFF",
"line2_highlight_padding": "4px 16px",
# Photo
@@ -89,7 +91,7 @@ def _load_config() -> dict:
"gradient_top_start_color": "rgba(0,0,0,0.5)",
"gradient_top_end_color": "transparent",
"gradient_bottom_start": "50%",
- "gradient_bottom_end_color": "#1A1A2E",
+ "gradient_bottom_end_color": "#FFFFFF",
"gradient_bottom_fade_point": "70%",
# Logo
diff --git a/backend/services/video_processor.py b/backend/services/video_processor.py
index db14cbd..0d8744f 100644
--- a/backend/services/video_processor.py
+++ b/backend/services/video_processor.py
@@ -46,6 +46,9 @@ from services.captions_burn import (
burn_captions,
create_gradient_png as _create_gradient_png,
)
+from services.local_reframe import (
+ detect_local_speaker_reframe_plan as _detect_local_speaker_reframe_plan,
+)
import sys
@@ -116,6 +119,45 @@ def crop_to_vertical(
speakers_in_clip = {
w.get("speaker") for w in (transcript_words or []) if w.get("speaker")
}
+
+ is_pure_split = (
+ face_map
+ and face_map.get("is_split_screen")
+ and not face_map.get("is_mixed_layout")
+ and len(face_map.get("clusters") or []) == 2
+ )
+ if is_pure_split:
+ plan = _detect_local_speaker_reframe_plan(input_path, face_map)
+ if plan and plan["mode"] == "pan":
+ crop_y = max(0, (height - plan["crop_h"]) // 2)
+ vf = (
+ f"crop={plan['crop_w']}:{plan['crop_h']}"
+ f":x='{plan['x_expression']}':y={crop_y},"
+ f"scale={target_w}:{target_h}"
+ )
+ print(
+ f" Reframe: local mouth-motion, {len(plan['timeline'])} segs, "
+ f"{plan['scene_cuts']} cuts",
+ flush=True,
+ )
+ result = _run_ffmpeg_with_fallback(
+ cmd_parts_before_enc=[
+ "ffmpeg", "-y",
+ "-i", input_path,
+ "-vf", vf,
+ ],
+ cmd_parts_after_enc=[
+ "-c:a", "aac",
+ "-b:a", "192k",
+ "-ar", "44100",
+ "-movflags", "+faststart",
+ ],
+ output_path=output_path,
+ label="crop_local_reframe",
+ )
+ if result:
+ return result
+
# Any clip with speaker labels should prefer clip-local tracking over the
# episode-wide face_map. Global speaker→side mappings are too coarse for
# monologues and mixed-layout edits; they can pin a single-speaker clip
diff --git a/docs/thumbnail-config.example.json b/docs/thumbnail-config.example.json
new file mode 100644
index 0000000..27318e7
--- /dev/null
+++ b/docs/thumbnail-config.example.json
@@ -0,0 +1,80 @@
+{
+ "_comment_about": "Copy this file to .podcli/thumbnail-config.json (or run `podcli init-thumbnail`). Every field is overridable; missing fields fall back to placeholder defaults. _comment_* keys are ignored by the loader -leave them in or strip them.",
+
+ "_comment_opt_in": "Set enabled to false to skip thumbnail generation even when this file exists.",
+ "enabled": true,
+
+ "_comment_canvas": "1080x1920 is YouTube Shorts / TikTok / Reels. Don't change unless you know why.",
+ "width": 1080,
+ "height": 1920,
+
+ "_comment_palette": "Three colors do most of the work. bg_color shows through the photo gradient at the bottom. text_color is line 1. accent_color is the highlight pill behind line 2 (or the frame border).",
+ "bg_color": "#0D0D0D",
+ "text_color": "#FFFFFF",
+ "accent_color": "#FF3366",
+
+ "_comment_frame": "Thin border around the whole 9:16 canvas. Set width to 0 to disable.",
+ "frame_border_width": 3,
+ "frame_border_color": null,
+
+ "_comment_text_box": "The white-ish card that sits over the bottom of the photo. box_y / box_y_with_photo are CSS top values - fraction or px.",
+ "box_x": "55px",
+ "box_y": "73%",
+ "box_y_with_photo": "76%",
+ "box_width": "970px",
+ "box_min_height": "180px",
+ "box_border_width": 3,
+ "box_border_color": null,
+ "box_fill_color": "rgba(13,13,13,0.85)",
+ "box_padding": "24px 32px",
+
+ "_comment_line1": "Top headline. Typically white. Keep short - line1_nowrap will scale text down to fit.",
+ "line1_font_size": "64px",
+ "line1_font_weight": "700",
+ "line1_letter_spacing": "1px",
+ "line1_line_height": 1.15,
+ "line1_margin_bottom": "10px",
+ "line1_uppercase": true,
+ "line1_color": "#FFFFFF",
+ "line1_nowrap": false,
+
+ "_comment_line2": "Second line - usually the punchline / hook. line2_text_color sits on top of the accent-colored highlight pill.",
+ "line2_font_size": "58px",
+ "line2_font_weight": "600",
+ "line2_font_style": "italic",
+ "line2_letter_spacing": "1px",
+ "line2_line_height": 1.15,
+ "line2_uppercase": true,
+ "line2_text_color": "#0D0D0D",
+ "line2_highlight_color": null,
+ "line2_highlight_padding": "6px 20px",
+
+ "_comment_photo": "Guest photo brightness multiplier (1.0 = unchanged). Drop it to 0.7 for moody, raise toward 1.0 for crisp.",
+ "photo_brightness": 0.85,
+
+ "_comment_gradient": "Vertical gradient over the photo. Top gradient softens any logo area; bottom gradient fades into bg_color behind the text box.",
+ "gradient_top_height": "25%",
+ "gradient_top_start_color": "rgba(0,0,0,0.5)",
+ "gradient_top_end_color": "transparent",
+ "gradient_bottom_start": "50%",
+ "gradient_bottom_end_color": "#0D0D0D",
+ "gradient_bottom_fade_point": "70%",
+
+ "_comment_logo": "Position one of: top-left, top-right, top-center, bottom-center, none. Logo image lives under .podcli/assets/ (register via manage_assets).",
+ "logo_position": "bottom-center",
+ "logo_height": "50px",
+ "logo_margin": "50px",
+ "logo_opacity": 0.35,
+
+ "_comment_font": "Use any Google Font or system font. font_import_url is fetched by the rendering browser. Strip both fields to use whatever's local.",
+ "font_family": "'Inter', 'Helvetica Neue', 'Arial', sans-serif",
+ "font_import_url": "https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap",
+
+ "_comment_variations": "Number of variations rendered per clip. variation_offset_up/down vertically shifts the text block in alternate variants.",
+ "variations": 3,
+ "variation_offset_up": "3%",
+ "variation_offset_down": "2%",
+
+ "_comment_pre_clip_thumbnail": "How long the still thumbnail plays at the start of the rendered short before the live video begins. 0.5–1.0s is the sweet spot.",
+ "intro_duration": 0.8
+}
diff --git a/src/ui/public/css/styles.css b/src/ui/public/css/styles.css
index 0558f45..c55c59d 100644
--- a/src/ui/public/css/styles.css
+++ b/src/ui/public/css/styles.css
@@ -135,6 +135,224 @@ h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1
.preview-tag strong { color: var(--text); font-weight: 600; text-transform: capitalize; }
.preview-tag.changed { border-color: var(--accent); background: var(--accent-subtle); }
+/* ─── Live Phone Preview ─── */
+.phone-frame {
+ width: 100%; max-width: 280px; margin: 0 auto;
+ aspect-ratio: 9/16; position: relative;
+ background: #000; border-radius: 28px;
+ border: 8px solid #1a1a1a;
+ box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.06);
+ overflow: hidden;
+}
+.phone-frame video,
+.phone-frame .phone-poster {
+ position: absolute; inset: 0; width: 100%; height: 100%;
+ object-fit: cover; background: #000;
+}
+.phone-frame .phone-notch {
+ position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
+ width: 84px; height: 22px; background: #000;
+ border-radius: 100px; z-index: 5;
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
+}
+.phone-frame .phone-caption {
+ position: absolute; left: 10px; right: 10px;
+ display: flex; flex-direction: column; align-items: center;
+ padding: 0 8px; text-align: center; pointer-events: none;
+ font-family: Arial, Helvetica, sans-serif; line-height: 1.3;
+ z-index: 2; transition: all 0.2s var(--ease);
+ max-height: 32%; /* never grow beyond the lower-third caption zone */
+ overflow: hidden;
+}
+.phone-frame .phone-caption .pc-word {
+ display: inline; transition: all 0.2s var(--ease);
+}
+.phone-frame .phone-gradient {
+ position: absolute; inset: auto 0 0 0; height: 50%;
+ background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 45%, transparent 100%);
+ pointer-events: none; z-index: 1;
+}
+.phone-frame .phone-logo {
+ position: absolute; top: 28px; left: 12px; width: 28px; height: 28px;
+ border-radius: 6px; overflow: hidden; z-index: 3;
+ background: rgba(0,0,0,0.5);
+}
+.phone-frame .phone-empty {
+ position: absolute; inset: 0; display: flex; flex-direction: column;
+ align-items: center; justify-content: center; gap: 6px;
+ color: rgba(255,255,255,0.4); font-size: 11px; text-align: center; padding: 0 24px;
+}
+
+/* ─── TikTok Wireframe Overlay ─── */
+.phone-frame .tt-overlay {
+ position: absolute; inset: 0; pointer-events: none; z-index: 4;
+ color: rgba(255,255,255,0.95); font-family: -apple-system, BlinkMacSystemFont, sans-serif;
+}
+.phone-frame .tt-top {
+ position: absolute; top: 38px; left: 0; right: 0;
+ display: flex; justify-content: center; align-items: center; gap: 14px;
+ font-size: 13px; font-weight: 700;
+ text-shadow: 0 1px 4px rgba(0,0,0,0.45);
+}
+.phone-frame .tt-top .tt-tab { opacity: 0.65; position: relative; padding-bottom: 4px; }
+.phone-frame .tt-top .tt-tab.active { opacity: 1; }
+.phone-frame .tt-top .tt-tab.active::after {
+ content: ""; position: absolute; left: 25%; right: 25%; bottom: 0;
+ height: 2px; border-radius: 2px; background: #fff;
+}
+.phone-frame .tt-top .tt-divider {
+ width: 1px; height: 12px; background: rgba(255,255,255,0.4);
+}
+.phone-frame .tt-top .tt-following-dot {
+ position: absolute; top: -2px; right: -6px;
+ width: 5px; height: 5px; border-radius: 50%; background: #ff3b5c;
+}
+.phone-frame .tt-search {
+ position: absolute; top: 38px; right: 12px;
+ width: 18px; height: 18px;
+ filter: drop-shadow(0 1px 3px rgba(0,0,0,0.55));
+}
+
+/* Right action rail */
+.phone-frame .tt-rail {
+ position: absolute; right: 8px; bottom: 44px;
+ display: flex; flex-direction: column; align-items: center; gap: 12px;
+}
+.phone-frame .tt-rail .tt-action {
+ display: flex; flex-direction: column; align-items: center; gap: 2px;
+ font-size: 10px; font-weight: 700;
+ text-shadow: 0 1px 3px rgba(0,0,0,0.75);
+ color: #fff;
+}
+.phone-frame .tt-rail .tt-icon {
+ width: 28px; height: 28px;
+ display: flex; align-items: center; justify-content: center;
+ filter: drop-shadow(0 1px 4px rgba(0,0,0,0.7));
+}
+
+/* Avatar with +follow badge */
+.phone-frame .tt-rail .tt-avatar-wrap {
+ position: relative; width: 34px; height: 34px; margin-bottom: 4px;
+}
+.phone-frame .tt-rail .tt-avatar {
+ width: 34px; height: 34px; border-radius: 50%;
+ background: #2a2a2a;
+ border: 2px solid #fff;
+ display: flex; align-items: center; justify-content: center;
+ overflow: hidden;
+ box-shadow: 0 2px 6px rgba(0,0,0,0.45);
+}
+.phone-frame .tt-rail .tt-avatar svg {
+ width: 22px; height: 22px; opacity: 0.45;
+}
+.phone-frame .tt-rail .tt-follow {
+ position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
+ width: 16px; height: 16px; border-radius: 50%;
+ background: #ff3b5c; color: #fff;
+ display: flex; align-items: center; justify-content: center;
+ font-weight: 900; font-size: 12px; line-height: 1;
+ border: 1.5px solid rgba(0,0,0,0); /* spacing illusion */
+}
+
+/* Music disc at bottom of rail */
+.phone-frame .tt-rail .tt-disc {
+ width: 32px; height: 32px; border-radius: 50%;
+ background:
+ radial-gradient(circle at 50% 50%, #555 0 5px, #1a1a1a 5px 14px, #2a2a2a 14px);
+ border: 1.5px solid rgba(255,255,255,0.18);
+ box-shadow: 0 2px 6px rgba(0,0,0,0.5);
+ animation: tt-spin 6s linear infinite;
+}
+@keyframes tt-spin { to { transform: rotate(360deg); } }
+
+/* Bottom-left text block */
+.phone-frame .tt-bottom {
+ position: absolute; left: 12px; right: 56px; bottom: 42px;
+ display: flex; flex-direction: column; gap: 3px;
+ text-shadow: 0 1px 4px rgba(0,0,0,0.7); color: #fff;
+}
+.phone-frame .tt-bottom .tt-handle {
+ font-weight: 800; font-size: 12px; line-height: 1.2;
+ letter-spacing: 0.3px;
+}
+.phone-frame .tt-bottom .tt-desc {
+ font-size: 10.5px; line-height: 1.35;
+ overflow: hidden;
+ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
+}
+.phone-frame .tt-bottom .tt-desc .tt-hash { color: #fff; }
+.phone-frame .tt-bottom .tt-desc .tt-more { opacity: 0.7; font-weight: 600; margin-left: 2px; }
+.phone-frame .tt-bottom .tt-translate {
+ font-size: 10px; opacity: 0.55;
+}
+.phone-frame .tt-bottom .tt-music {
+ display: flex; align-items: center; gap: 5px;
+ font-size: 10px; opacity: 0.95; margin-top: 1px;
+}
+.phone-frame .tt-bottom .tt-music-note { font-size: 11px; line-height: 1; }
+
+/* Bottom nav */
+.phone-frame .tt-nav {
+ position: absolute; left: 0; right: 0; bottom: 0;
+ display: flex; justify-content: space-around; align-items: center;
+ height: 36px; padding: 0 6px;
+ background: rgba(0,0,0,0.65);
+ border-top: 1px solid rgba(255,255,255,0.06);
+}
+.phone-frame .tt-nav .tt-nav-item {
+ display: flex; flex-direction: column; align-items: center; gap: 2px;
+ font-size: 8px; font-weight: 700; opacity: 0.78;
+}
+.phone-frame .tt-nav .tt-nav-item.active { opacity: 1; }
+.phone-frame .tt-nav .tt-nav-icon { width: 18px; height: 18px; }
+.phone-frame .tt-nav .tt-plus {
+ width: 36px; height: 22px; border-radius: 6px;
+ position: relative; display: flex; align-items: center; justify-content: center;
+ background: #fff; color: #000;
+ font-weight: 900; font-size: 14px; line-height: 1;
+ box-shadow:
+ -3px 0 0 #25f4ee,
+ 3px 0 0 #fe2c55;
+}
+
+/* Wireframe toggle button under the phone */
+.preview-toggle-row {
+ display: flex; justify-content: center; align-items: center;
+ gap: 12px; margin-top: 10px; font-size: 11px; color: var(--text2);
+}
+.preview-toggle-row label {
+ display: flex; align-items: center; gap: 6px; cursor: pointer;
+ user-select: none;
+}
+.preview-toggle-row input[type="checkbox"] {
+ width: 14px; height: 14px; accent-color: var(--accent);
+}
+
+/* ─── Spec Recap Card ─── */
+.spec-recap {
+ margin-top: 14px; padding: 12px 14px;
+ background: var(--surface); border: 1px solid var(--border);
+ border-radius: var(--radius); font-size: 11px;
+}
+.spec-recap .sr-row {
+ display: flex; justify-content: space-between; align-items: center;
+ padding: 5px 0; border-bottom: 1px dashed var(--border);
+}
+.spec-recap .sr-row:last-child { border-bottom: none; }
+.spec-recap .sr-key {
+ color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
+ font-weight: 600; font-size: 10px;
+}
+.spec-recap .sr-val {
+ color: var(--text); font-weight: 600; font-family: var(--font-mono);
+ font-size: 11px; max-width: 60%;
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+}
+.spec-recap .sr-swatch {
+ display: inline-block; width: 10px; height: 10px; border-radius: 2px;
+ border: 1px solid var(--border); margin-right: 6px; vertical-align: middle;
+}
+
/* ─── Sections ─── */
.section { margin-bottom: 24px; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: var(--text2); margin-bottom: 10px; text-transform: uppercase; }
diff --git a/src/ui/public/index.html b/src/ui/public/index.html
index 66a6a0b..1c37a24 100644
--- a/src/ui/public/index.html
+++ b/src/ui/public/index.html
@@ -4,12 +4,43 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>podcli</title>
+
+ <title>Podcli - AI Podcast Clip Studio</title>
+ <meta name="description" content="Transcribe podcast videos, find viral moments, and export branded vertical clips with burned captions. Open-source local-first studio for YouTube Shorts, TikTok, and Reels.">
+ <meta name="author" content="Podcli">
+ <meta name="application-name" content="Podcli">
+ <meta name="generator" content="Podcli">
+ <meta name="robots" content="noindex,nofollow">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <meta name="format-detection" content="telephone=no">
+
+ <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
+ <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
+ <meta name="color-scheme" content="dark light">
+
+ <meta property="og:type" content="website">
+ <meta property="og:site_name" content="Podcli">
+ <meta property="og:title" content="Podcli - AI Podcast Clip Studio">
+ <meta property="og:description" content="Transcribe podcast videos, find viral moments, and export branded vertical clips with burned captions.">
+ <meta property="og:image" content="/podcli-logo-transparent.png">
+ <meta name="twitter:card" content="summary_large_image">
+ <meta name="twitter:title" content="Podcli - AI Podcast Clip Studio">
+ <meta name="twitter:description" content="Transcribe podcast videos, find viral moments, and export branded vertical clips with burned captions.">
+ <meta name="twitter:image" content="/podcli-logo-transparent.png">
+
<link rel="icon" type="image/png" href="/podcli-icon.png">
+ <link rel="apple-touch-icon" href="/podcli-icon.png">
+ <link rel="mask-icon" href="/podcli-icon-transparent.png" color="#0d0d0d">
+
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-title" content="Podcli">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
+ <meta name="mobile-web-app-capable" content="yes">
+
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap"
+ href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700;800&display=swap"
rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js"></script>
@@ -21,7 +52,7 @@
<div id="root"></div>
<script type="text/babel">
- const { useState, useEffect, useRef, useCallback } = React;
+ const { useState, useEffect, useRef, useCallback, useMemo } = React;
const fmt = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`;
const api = async (path, opts = {}) => (await fetch(`/api${path}`, { headers: { 'Content-Type': 'application/json', ...opts.headers }, ...opts })).json();
@@ -75,73 +106,391 @@
const CheckIcon = () => (<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M2.5 6L5 8.5L9.5 3.5" stroke="#fff" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" /></svg>);
const CheckSmall = ({ color = 'var(--green)' }) => (<svg width="10" height="10" viewBox="0 0 12 12" fill="none"><path d="M2.5 6L5 8.5L9.5 3.5" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" /></svg>);
- /* ── Style Preview Component ── */
+ const PREVIEW_SCALE = 0.27;
+ const px = (n) => Math.round(n * PREVIEW_SCALE);
+ const PROD_TO_PCT = (margin) => ((margin / 1920) * 100).toFixed(1) + '%';
+
const STYLE_CONFIGS = {
branded: {
- words: ['Did you ever,', 'felt', 'like I\u2019m in the', 'wrong place'],
- fontSize: 19, fontWeight: 800, bottom: '30%',
- lineHeight: 1.3, textShadow: 'none',
- activeStyle: { background: '#1a1a1a', borderRadius: 5, padding: '2px 6px', color: '#fff' },
- normalStyle: { background: 'transparent', borderRadius: 5, padding: '2px 6px', color: '#fff' },
- gradient: true,
+ fontSize: px(100), fontWeight: 700, bottom: PROD_TO_PCT(420),
+ lineHeight: 1.2, uppercase: false,
+ wordsPerChunk: 3, maxCharsPerChunk: 18, splitLines: true,
+ color: '#fff', activeColor: '#fff',
+ activePill: { background: 'rgba(0,0,0,0.85)', borderRadius: 8, paddingX: 8 },
+ chunkBg: null, gradient: true,
+ sample: ['Did', 'you', 'ever', 'felt', 'like', 'this'],
},
hormozi: {
- words: ['LOOKING', 'FOR', 'HIGH ENERGY'],
- fontSize: 22, fontWeight: 900, bottom: '22%',
- lineHeight: 1.25, textShadow: '0 2px 8px rgba(0,0,0,0.7)',
- activeStyle: { color: '#ffff00' },
- normalStyle: { color: '#fff' },
+ fontSize: px(90), fontWeight: 800, bottom: PROD_TO_PCT(400),
+ lineHeight: 1.2, uppercase: true,
+ wordsPerChunk: 3, maxCharsPerChunk: 22, splitLines: false,
+ color: '#fff', activeColor: '#ffff00',
+ activePill: null,
+ chunkBg: { background: 'rgba(0,0,0,0.8)', borderRadius: 5, paddingX: 10, paddingY: 5 },
gradient: false,
+ sample: ['LOOKING', 'FOR', 'HIGH', 'ENERGY', 'CONTENT'],
},
karaoke: {
- words: ['the secret to', 'building', 'something', 'people', 'actually want'],
- fontSize: 15, fontWeight: 600, bottom: '22%',
- lineHeight: 1.4, textShadow: '0 1px 6px rgba(0,0,0,0.6)',
- activeStyle: { color: '#fff' },
- normalStyle: { color: 'rgba(255,255,255,0.35)' },
- gradient: false,
+ fontSize: px(80), fontWeight: 600, bottom: PROD_TO_PCT(400),
+ lineHeight: 1.25, uppercase: false,
+ wordsPerChunk: 5, maxCharsPerChunk: 28, splitLines: false,
+ color: 'rgba(255,255,255,0.4)', activeColor: '#fff',
+ activePill: null, chunkBg: null, gradient: false,
+ sample: ['the', 'secret', 'to', 'building', 'something'],
},
subtle: {
- words: ['the secret to building something people actually want'],
- fontSize: 13, fontWeight: 400, bottom: '12%',
- lineHeight: 1.5, textShadow: '0 1px 4px rgba(0,0,0,0.8)',
- activeStyle: { color: 'rgba(255,255,255,0.9)' },
- normalStyle: { color: 'rgba(255,255,255,0.9)' },
- gradient: false,
+ fontSize: px(64), fontWeight: 400, bottom: PROD_TO_PCT(200),
+ lineHeight: 1.3, uppercase: false,
+ wordsPerChunk: 6, maxCharsPerChunk: 36, splitLines: false,
+ color: 'rgba(255,255,255,0.95)', activeColor: 'rgba(255,255,255,0.95)',
+ activePill: null, chunkBg: null, gradient: false,
+ sample: ['the', 'secret', 'to', 'building', 'something', 'people'],
},
};
- function StylePreview({ style, logoPath }) {
- const [activeIdx, setActiveIdx] = useState(0);
- const cfg = STYLE_CONFIGS[style] || STYLE_CONFIGS.branded;
+ function buildPreviewChunks(words, perChunk, maxChars) {
+ const out = [];
+ let i = 0;
+ while (i < words.length) {
+ let end = i, count = 0;
+ while (end < words.length && end - i < perChunk) {
+ const w = words[end];
+ const next = count === 0 ? w.length : count + 1 + w.length;
+ if (end > i && maxChars && next > maxChars) break;
+ count = next; end++;
+ }
+ if (end === i) end = i + 1;
+ if (words.length - end === 1 && end - i > 2) end -= 1;
+ out.push(words.slice(i, end));
+ i = end;
+ }
+ return out;
+ }
+ function splitBrandedLines(chunk) {
+ if (chunk.length <= 2) return [chunk, []];
+ return [chunk.slice(0, 2), chunk.slice(2)];
+ }
- useEffect(() => {
- if (cfg.words.length <= 1) return;
- const iv = setInterval(() => setActiveIdx(i => (i + 1) % cfg.words.length), 800);
- return () => clearInterval(iv);
- }, [style]);
- useEffect(() => setActiveIdx(0), [style]);
+ function TikTokWireframe({ activeClip, captionStyle }) {
+ const Heart = () => (
+ <svg width="28" height="28" viewBox="0 0 24 24" fill="#fff">
+ <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
+ </svg>
+ );
+ const Comment = () => (
+ <svg width="28" height="28" viewBox="0 0 24 24" fill="#fff">
+ <path d="M20 2H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3l5 4 5-4h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z"/>
+ </svg>
+ );
+ const Bookmark = () => (
+ <svg width="24" height="28" viewBox="0 0 24 24" fill="#fff">
+ <path d="M17 3H7a2 2 0 0 0-2 2v17l7-3.5L19 22V5a2 2 0 0 0-2-2z"/>
+ </svg>
+ );
+ const Share = () => (
+ <svg width="28" height="28" viewBox="0 0 24 24" fill="#fff">
+ <path d="M22 12L12 4v5c-7 0-10 4-10 11 2-4 5-6 10-6v5l10-7z"/>
+ </svg>
+ );
+ const MusicNote = () => (
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="#fff">
+ <path d="M9 17V5l12-2v12a4 4 0 1 1-2-3.46V6.18L11 7.82V19a4 4 0 1 1-2-3.46z"/>
+ </svg>
+ );
+ const Person = () => (
+ <svg viewBox="0 0 24 24" fill="#fff">
+ <path d="M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0 2c-4 0-8 2-8 6v2h16v-2c0-4-4-6-8-6z"/>
+ </svg>
+ );
+ const Search = () => (
+ <svg viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" style={{ width: '100%', height: '100%' }}>
+ <circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.5" y2="16.5"/>
+ </svg>
+ );
+ const NavHome = () => (
+ <svg viewBox="0 0 24 24" fill="#fff" className="tt-nav-icon"><path d="M3 11l9-8 9 8v10h-6v-6h-6v6H3z"/></svg>
+ );
+ const NavFriends = () => (
+ <svg viewBox="0 0 24 24" fill="#fff" className="tt-nav-icon"><circle cx="9" cy="8" r="4"/><circle cx="17" cy="9" r="3"/><path d="M2 20c0-4 4-6 7-6s7 2 7 6v1H2v-1zm14-5c2 0 6 1 6 5v1h-6"/></svg>
+ );
+ const NavInbox = () => (
+ <svg viewBox="0 0 24 24" fill="#fff" className="tt-nav-icon"><path d="M3 6h18l-2 8h-7l-2 3-2-3H5z"/></svg>
+ );
+ const NavProfile = () => (
+ <svg viewBox="0 0 24 24" fill="#fff" className="tt-nav-icon"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-5 4-7 8-7s8 2 8 7"/></svg>
+ );
+ const fmtCount = (n) => {
+ if (n >= 100000) return (n / 1000).toFixed(1).replace(/\.0$/, '') + 'K';
+ if (n >= 1000) return (n / 1000).toFixed(1).replace(/\.0$/, '') + 'K';
+ return String(n);
+ };
+ const likes = fmtCount(999000);
+ const comments = fmtCount(2463);
+ const saves = fmtCount(60500);
+ const shares = fmtCount(2230);
+ const caption = activeClip ? activeClip.title : 'Description #shorts #podcast';
+ return (
+ <div className="tt-overlay">
+ <div className="tt-top">
+ <span className="tt-tab">
+ Following
+ <span className="tt-following-dot" />
+ </span>
+ <span className="tt-divider" />
+ <span className="tt-tab active">For You</span>
+ </div>
+ <div className="tt-search"><Search /></div>
+ <div className="tt-rail">
+ <div className="tt-avatar-wrap">
+ <div className="tt-avatar"><Person /></div>
+ <div className="tt-follow">+</div>
+ </div>
+ <div className="tt-action"><div className="tt-icon"><Heart /></div><span>{likes}</span></div>
+ <div className="tt-action"><div className="tt-icon"><Comment /></div><span>{comments}</span></div>
+ <div className="tt-action"><div className="tt-icon"><Bookmark /></div><span>{saves}</span></div>
+ <div className="tt-action"><div className="tt-icon"><Share /></div><span>{shares}</span></div>
+ <div className="tt-disc" />
+ </div>
+ <div className="tt-bottom">
+ <div className="tt-handle">USERNAME</div>
+ <div className="tt-desc">{caption}<span className="tt-more"> more</span></div>
+ <div className="tt-translate">see translation</div>
+ <div className="tt-music">
+ <span className="tt-music-note"><MusicNote /></span>
+ <span>Original Sound</span>
+ </div>
+ </div>
+ <div className="tt-nav">
+ <div className="tt-nav-item active"><NavHome /><span>Home</span></div>
+ <div className="tt-nav-item"><NavFriends /><span>Friends</span></div>
+ <div className="tt-nav-item"><div className="tt-plus">+</div></div>
+ <div className="tt-nav-item"><NavInbox /><span>Inbox</span></div>
+ <div className="tt-nav-item"><NavProfile /><span>Profile</span></div>
+ </div>
+ </div>
+ );
+ }
- const showLogo = style === 'branded' && logoPath;
+ function PhoneCaptionBody({ chunk, activeWordInChunk, cfg }) {
+ if (!chunk || !chunk.length) return null;
+ const fmt = (w) => (cfg.uppercase ? w.toUpperCase() : w);
+
+ const renderWord = (w, i, isActive) => {
+ if (cfg.activePill && isActive) {
+ // Branded: black rounded pill behind the active word.
+ return (
+ <span key={`${w}-${i}`} style={{ position: 'relative', display: 'inline-block' }}>
+ <span style={{
+ position: 'absolute',
+ top: -2, bottom: -2,
+ left: -cfg.activePill.paddingX, right: -cfg.activePill.paddingX,
+ background: cfg.activePill.background,
+ borderRadius: cfg.activePill.borderRadius,
+ boxShadow: '0 2px 8px rgba(0,0,0,0.45)',
+ pointerEvents: 'none',
+ }} />
+ <span style={{ position: 'relative', color: cfg.activeColor, zIndex: 1 }}>{fmt(w)}</span>
+ </span>
+ );
+ }
+ return (
+ <span key={`${w}-${i}`} style={{
+ color: isActive ? cfg.activeColor : cfg.color,
+ textShadow: isActive && cfg.activeColor === '#ffff00'
+ ? '0 0 12px rgba(255,255,0,0.5)' : '0 1px 4px rgba(0,0,0,0.6)',
+ transition: 'color 0.15s var(--ease)',
+ }}>{fmt(w)}</span>
+ );
+ };
+
+ // Branded: split chunk into [first 2 words, rest], render as 2 lines.
+ if (cfg.splitLines) {
+ const [line1, line2] = splitBrandedLines(chunk);
+ const startIdx2 = line1.length;
+ return (
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
+ <div style={{ whiteSpace: 'nowrap' }}>
+ {line1.map((w, i) => (
+ <React.Fragment key={`l1-${i}`}>
+ {i > 0 && ' '}
+ {renderWord(w, i, i === activeWordInChunk)}
+ </React.Fragment>
+ ))}
+ </div>
+ {line2.length > 0 && (
+ <div style={{ whiteSpace: 'nowrap' }}>
+ {line2.map((w, i) => (
+ <React.Fragment key={`l2-${i}`}>
+ {i > 0 && ' '}
+ {renderWord(w, startIdx2 + i, startIdx2 + i === activeWordInChunk)}
+ </React.Fragment>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+ }
+
+ // Hormozi: whole chunk inside a single black box, active word yellow.
+ // Karaoke / subtle: no box, just inline words.
+ const inner = chunk.map((w, i) => (
+ <React.Fragment key={i}>
+ {i > 0 && ' '}
+ {renderWord(w, i, i === activeWordInChunk)}
+ </React.Fragment>
+ ));
+
+ if (cfg.chunkBg) {
+ return (
+ <div style={{
+ display: 'inline-block',
+ background: cfg.chunkBg.background,
+ borderRadius: cfg.chunkBg.borderRadius,
+ padding: `${cfg.chunkBg.paddingY}px ${cfg.chunkBg.paddingX}px`,
+ whiteSpace: 'nowrap',
+ }}>{inner}</div>
+ );
+ }
+ return <div style={{ whiteSpace: 'normal' }}>{inner}</div>;
+ }
+
+ function LivePhonePreview({ videoUrl, videoRef, captionStyle, activeClip, transcriptWords, logoPath, previewSrc, showTikTokFrame, onToggleFrame }) {
+ const cfg = STYLE_CONFIGS[captionStyle] || STYLE_CONFIGS.branded;
+ const [logoBroken, setLogoBroken] = useState(false);
+ useEffect(() => { setLogoBroken(false); }, [logoPath]);
+
+ // Pull all transcribed words from the active clip (or first N from the
+ // whole transcript). The chunker decides how many show at once.
+ const sourcePool = useMemo(() => {
+ if (!transcriptWords || !transcriptWords.length) return null;
+ let pool = transcriptWords;
+ if (activeClip) {
+ pool = transcriptWords.filter(w =>
+ w.end > activeClip.start_second && w.start < activeClip.end_second
+ );
+ }
+ if (!pool.length) return null;
+ const out = pool.slice(0, 80).map(w => (w.word || w.text || '').trim()).filter(Boolean);
+ return out.length >= 2 ? out : null;
+ }, [activeClip, transcriptWords]);
+
+ const usingSample = !sourcePool;
+ const poolWords = sourcePool || cfg.sample;
+
+ // Chunk the same way the Remotion renderer does. The active chunk
+ // is what appears on screen; the active word inside it gets the
+ // pill / accent color.
+ const chunks = useMemo(
+ () => buildPreviewChunks(poolWords, cfg.wordsPerChunk, cfg.maxCharsPerChunk),
+ [poolWords, cfg.wordsPerChunk, cfg.maxCharsPerChunk]
+ );
+
+ const [cursor, setCursor] = useState(0); // global word index
+ useEffect(() => {
+ setCursor(0);
+ if (poolWords.length <= 1) return;
+ const tick = captionStyle === 'karaoke' ? 320 : 420;
+ const iv = setInterval(() => setCursor(i => (i + 1) % poolWords.length), tick);
+ return () => clearInterval(iv);
+ }, [captionStyle, poolWords.length, poolWords[0]]);
+
+ // Find which chunk the cursor is currently in, and which word within it.
+ let activeChunkIdx = 0, activeWordInChunk = 0, consumed = 0;
+ for (let ci = 0; ci < chunks.length; ci++) {
+ const len = chunks[ci].length;
+ if (cursor < consumed + len) {
+ activeChunkIdx = ci;
+ activeWordInChunk = cursor - consumed;
+ break;
+ }
+ consumed += len;
+ }
+ const activeChunk = chunks[activeChunkIdx] || [];
return (
- <div className="style-preview fade-in" key={style}>
- <div className="sp-bg" />
- <div className="sp-person" />
- {cfg.gradient && <div className="sp-gradient" />}
- {showLogo && (
- <div className="sp-logo">
- <img src={`/api/stream-source?path=${encodeURIComponent(logoPath)}`} style={{ width: '100%', height: '100%', objectFit: 'contain', borderRadius: 6 }} />
+ <>
+ <div className="phone-frame fade-in">
+ <div className="phone-notch" />
+ {videoUrl ? (
+ <video key={videoUrl} ref={videoRef} src={videoUrl}
+ muted playsInline preload="auto"
+ className={previewSrc ? '' : ''} />
+ ) : (
+ <div className="phone-empty">
+ <div style={{ fontSize: 22, opacity: 0.4 }}>{'▶'}</div>
+ <div>Drop a video to see live caption preview</div>
</div>
)}
- <div className="sp-captions" style={{ bottom: cfg.bottom, fontSize: cfg.fontSize, fontWeight: cfg.fontWeight, lineHeight: cfg.lineHeight, textShadow: cfg.textShadow }}>
- <div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center', gap: '4px 6px' }}>
- {cfg.words.map((w, i) => (
- <span key={w} className="sp-word" style={i === activeIdx ? cfg.activeStyle : cfg.normalStyle}>{w}</span>
- ))}
+ {videoUrl && cfg.gradient && <div className="phone-gradient" />}
+ {videoUrl && captionStyle === 'branded' && logoPath && !logoBroken && (
+ <div className="phone-logo">
+ <img src={`/api/stream-source?path=${encodeURIComponent(logoPath)}`}
+ onError={() => setLogoBroken(true)}
+ style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
</div>
- </div>
+ )}
+ {videoUrl && (
+ <div className="phone-caption" style={{
+ bottom: cfg.bottom,
+ fontSize: cfg.fontSize, fontWeight: cfg.fontWeight,
+ lineHeight: cfg.lineHeight,
+ fontFamily: "'DM Sans', 'Inter', Arial, sans-serif",
+ }}>
+ <PhoneCaptionBody
+ chunk={activeChunk}
+ activeWordInChunk={activeWordInChunk}
+ cfg={cfg}
+ />
+ {usingSample && (
+ <div style={{
+ marginTop: 6, fontSize: 9, fontWeight: 600, color: 'rgba(255,255,255,0.55)',
+ textShadow: '0 1px 3px rgba(0,0,0,0.6)', letterSpacing: '0.5px',
+ textTransform: 'uppercase', pointerEvents: 'none',
+ }}>
+ Placeholder · transcribe to see your captions
+ </div>
+ )}
+ </div>
+ )}
+ {videoUrl && showTikTokFrame && (
+ <TikTokWireframe activeClip={activeClip} captionStyle={captionStyle} />
+ )}
+ </div>
+ <div className="preview-toggle-row">
+ <label>
+ <input type="checkbox" checked={!!showTikTokFrame} onChange={onToggleFrame} />
+ TikTok wireframe
+ </label>
+ </div>
+ </>
+ );
+ }
+
+ /* ── Spec Recap ── re-renders form state as a reviewable card. */
+ function SpecRecap({ captionStyle, cropStrategy, logoPath, outroPath, activePreset, quality, cleanFillers }) {
+ const cfg = STYLE_CONFIGS[captionStyle] || STYLE_CONFIGS.branded;
+ // Sample "color" comes from the active-word style of the caption preset.
+ const swatch = (cfg.activeStyle && (cfg.activeStyle.color || cfg.activeStyle.background)) || '#ffffff';
+ const rows = [
+ ['Caption style', captionStyle],
+ ['Crop', cropStrategy],
+ ['Font size', `${cfg.fontSize}px`],
+ ['Highlight', <span><span className="sr-swatch" style={{ background: swatch }} />{swatch}</span>],
+ ['Quality', quality || 'standard'],
+ ['Clean fillers', cleanFillers ? 'on' : 'off'],
+ ];
+ if (logoPath) rows.push(['Logo', logoPath.split('/').pop()]);
+ if (outroPath) rows.push(['Outro', outroPath.split('/').pop()]);
+ if (activePreset) rows.push(['Preset', activePreset]);
+ return (
+ <div className="spec-recap fade-in">
+ {rows.map(([k, v]) => (
+ <div className="sr-row" key={k}>
+ <span className="sr-key">{k}</span>
+ <span className="sr-val">{v}</span>
+ </div>
+ ))}
</div>
);
}
@@ -209,7 +558,8 @@
const [timeAdjust, setTimeAdjust] = useState(-1);
const [whisperModel, setWhisperModel] = useState('base');
const [captionStyle, setCaptionStyle] = useState('branded');
- const [cropStrategy, setCropStrategy] = useState('speaker');
+ const [cropStrategy, setCropStrategy] = useState('face');
+ const [showTikTokFrame, setShowTikTokFrame] = useState(false);
const [logoPath, setLogoPath] = useState('');
const logoRef = useRef();
const [outroPath, setOutroPath] = useState('');
@@ -256,7 +606,7 @@
// Advanced settings
const [advancedOpen, setAdvancedOpen] = useState(false);
- const [cleanFillers, setCleanFillers] = useState(false);
+ const [cleanFillers, setCleanFillers] = useState(true);
const [quality, setQuality] = useState('max');
const [topClips, setTopClips] = useState(8);
const [minDuration, setMinDuration] = useState(20);
@@ -1380,8 +1730,9 @@
<div className="preview-col">
<div className="preview-panel">
- {/* Video player (when video loaded) */}
- {videoUrl && (
+ {/* Old video player - used ONLY for playing a rendered clip.
+ Source-video preview now lives inside <LivePhonePreview/>. */}
+ {videoUrl && previewSrc && (
<div className="preview-player fade-in" style={{ marginBottom: 12 }}>
<video
key={videoUrl}
@@ -1407,8 +1758,19 @@
)}
{/* Style preview mockup — hidden when rendered clip is playing */}
- {!previewSrc && <StylePreview style={captionStyle} logoPath={logoPath} />}
-
+ {!previewSrc && (
+ <LivePhonePreview
+ videoUrl={videoUrl}
+ videoRef={videoRef}
+ captionStyle={captionStyle}
+ activeClip={activeClip}
+ transcriptWords={transcript ? transcript.words : null}
+ logoPath={logoPath}
+ previewSrc={previewSrc}
+ showTikTokFrame={showTikTokFrame}
+ onToggleFrame={() => setShowTikTokFrame(v => !v)}
+ />
+ )}
{/* Settings tags */}
<div className="preview-settings">
<div className={`preview-tag ${settingsFlash === 'caption' ? 'changed' : ''}`}
@@ -1440,6 +1802,17 @@
</div>
)}
</div>
+
+ {/* Spec recap \u2014 form state as a reviewable summary card */}
+ <SpecRecap
+ captionStyle={captionStyle}
+ cropStrategy={cropStrategy}
+ logoPath={logoPath}
+ outroPath={outroPath}
+ activePreset={activePreset}
+ quality={quality}
+ cleanFillers={cleanFillers}
+ />
</div>
</div>
</div>
diff --git a/src/ui/public/integration.html b/src/ui/public/integration.html
index 3f89546..8908798 100644
--- a/src/ui/public/integration.html
+++ b/src/ui/public/integration.html
@@ -4,8 +4,29 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>podcli — Integration</title>
+
+ <title>Podcli - MCP Integration</title>
+ <meta name="description" content="Wire Podcli into Claude Code, Claude Desktop, Cursor, or any MCP-compatible client. Copy the config snippet for your tool of choice.">
+ <meta name="author" content="Podcli">
+ <meta name="application-name" content="Podcli">
+ <meta name="robots" content="noindex,nofollow">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <meta name="format-detection" content="telephone=no">
+
+ <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
+ <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
+ <meta name="color-scheme" content="dark light">
+
+ <meta property="og:type" content="website">
+ <meta property="og:site_name" content="Podcli">
+ <meta property="og:title" content="Podcli - MCP Integration">
+ <meta property="og:description" content="Wire Podcli into Claude Code, Claude Desktop, Cursor, or any MCP-compatible client.">
+ <meta property="og:image" content="/podcli-logo-transparent.png">
+
<link rel="icon" type="image/png" href="/podcli-icon.png">
+ <link rel="apple-touch-icon" href="/podcli-icon.png">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-title" content="Podcli">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
@@ -189,7 +210,7 @@
const txt = document.getElementById('status-text');
if (data.server_ok) {
bar.className = 'status-bar ok';
- txt.textContent = `Server running — ${data.tools_count} tools available`;
+ txt.textContent = `Server running - ${data.tools_count} tools available`;
} else {
bar.className = 'status-bar err';
txt.textContent = 'Server not built. Run: npm run build';
diff --git a/src/ui/public/knowledge.html b/src/ui/public/knowledge.html
index e16a8d1..653f9de 100644
--- a/src/ui/public/knowledge.html
+++ b/src/ui/public/knowledge.html
@@ -4,8 +4,29 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>podcli — Knowledge Base</title>
+
+ <title>Podcli - Knowledge Base</title>
+ <meta name="description" content="Edit the brand brain that drives Podcli's title formulas, voice and tone, descriptions, and thumbnail copy.">
+ <meta name="author" content="Podcli">
+ <meta name="application-name" content="Podcli">
+ <meta name="robots" content="noindex,nofollow">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <meta name="format-detection" content="telephone=no">
+
+ <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
+ <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
+ <meta name="color-scheme" content="dark light">
+
+ <meta property="og:type" content="website">
+ <meta property="og:site_name" content="Podcli">
+ <meta property="og:title" content="Podcli - Knowledge Base">
+ <meta property="og:description" content="Edit the brand brain that drives Podcli's title formulas, voice and tone, descriptions, and thumbnail copy.">
+ <meta property="og:image" content="/podcli-logo-transparent.png">
+
<link rel="icon" type="image/png" href="/podcli-icon.png">
+ <link rel="apple-touch-icon" href="/podcli-icon.png">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-title" content="Podcli">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
@@ -142,7 +163,7 @@
<div className="header">
<h1>Knowledge Base</h1>
<p className="subtitle">
- Add .md files to give the AI context about your podcast — hosts, style preferences, audience, topics to avoid.
+ Add .md files to give the AI context about your podcast - hosts, style preferences, audience, topics to avoid.
The MCP server reads these before every request.
</p>
{kbDir && <div className="dir-path">{kbDir}</div>}