@clipen/clipen-cli 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +16 -6
  2. package/apps/web/dist/assets/index-DPgSvXZ1.js +15 -0
  3. package/apps/web/dist/assets/index-DmPWV61v.css +1 -0
  4. package/apps/web/dist/index.html +2 -2
  5. package/bin/clipen.js +229 -68
  6. package/package.json +8 -2
  7. package/pyproject.toml +1 -1
  8. package/src/clipen/__init__.py +1 -1
  9. package/src/clipen/analysis/qwen_worker.py +13 -4
  10. package/src/clipen/analysis/setup.py +2 -1
  11. package/src/clipen/analysis/setup_cli.py +58 -12
  12. package/src/clipen/bootstrap.py +499 -167
  13. package/src/clipen/cli.py +40 -15
  14. package/src/clipen/controller/app.py +120 -38
  15. package/src/clipen/controller/server.py +70 -27
  16. package/src/clipen/editing/agent_repository.py +8 -0
  17. package/src/clipen/editing/agent_tools.py +1 -1
  18. package/src/clipen/editing/caption_design.py +134 -0
  19. package/src/clipen/editing/change_report.py +17 -0
  20. package/src/clipen/editing/component_looks.py +3 -3
  21. package/src/clipen/editing/component_review.py +0 -38
  22. package/src/clipen/editing/coordinator.py +20 -0
  23. package/src/clipen/editing/evidence_jobs.py +3 -1
  24. package/src/clipen/editing/history_changes.py +56 -27
  25. package/src/clipen/editing/production_catalog.py +67 -13
  26. package/src/clipen/editing/production_media.py +13 -2
  27. package/src/clipen/editing/production_preview.py +11 -9
  28. package/src/clipen/editing/production_progress.py +48 -3
  29. package/src/clipen/editing/production_tools.py +11 -20
  30. package/src/clipen/editing/program_subtitles.py +5 -13
  31. package/src/clipen/editing/resolve_export.py +2 -183
  32. package/src/clipen/editing/skill_tools.py +142 -218
  33. package/src/clipen/editing/tool_receipts.py +2 -1
  34. package/src/clipen/editing/versions.py +55 -10
  35. package/src/clipen/editing/visual_preview.py +62 -0
  36. package/src/clipen/editing/workbench.py +21 -1
  37. package/src/clipen/i18n.py +155 -0
  38. package/src/clipen/locale_en.py +546 -0
  39. package/src/clipen/mcp_editing/__main__.py +8 -0
  40. package/src/clipen/media/storage.py +2 -2
  41. package/src/clipen/own_ffmpeg.py +113 -0
  42. package/src/clipen/projects/models.py +16 -1
  43. package/src/clipen/projects/picker.py +3 -1
  44. package/src/clipen/projects/storage.py +17 -1
  45. package/src/clipen/providers/claude_editing.py +3 -1
  46. package/src/clipen/providers/codex_editing.py +3 -1
  47. package/src/clipen/providers/editing_agent.py +42 -5
  48. package/src/clipen/providers/liveness.py +39 -0
  49. package/src/clipen/rendering/custom_components.py +216 -25
  50. package/src/clipen/rendering/custom_render.py +90 -54
  51. package/src/clipen/rendering/fetched_fonts.py +127 -0
  52. package/src/clipen/rendering/production_effects.py +24 -2
  53. package/src/clipen/rendering/program_components.py +18 -240
  54. package/src/clipen/rendering/renderer.py +23 -17
  55. package/src/clipen/rendering/titles.py +29 -12
  56. package/src/clipen/skills/builtin/SKILL.md +3 -3
  57. package/src/clipen/skills/builtin/assets/sample-daily-vlog.mp4 +0 -0
  58. package/src/clipen/skills/builtin/assets/sample-event-recap.mp4 +0 -0
  59. package/src/clipen/skills/builtin/assets/sample-food-review.mp4 +0 -0
  60. package/src/clipen/skills/builtin/assets/sample-product-demo.mp4 +0 -0
  61. package/src/clipen/skills/builtin/assets/sample-product-review.mp4 +0 -0
  62. package/src/clipen/skills/builtin/assets/sample-product-unboxing.mp4 +0 -0
  63. package/src/clipen/skills/builtin/assets/sample-shorts-highlight.mp4 +0 -0
  64. package/src/clipen/skills/builtin/assets/sample-travel-highlight.mp4 +0 -0
  65. package/src/clipen/skills/builtin/assets/sample-travel-vlog.mp4 +0 -0
  66. package/src/clipen/skills/builtin/assets/style-tpl-daily-vlog.png +0 -0
  67. package/src/clipen/skills/builtin/assets/style-tpl-event-recap.png +0 -0
  68. package/src/clipen/skills/builtin/assets/style-tpl-food-review.png +0 -0
  69. package/src/clipen/skills/builtin/assets/style-tpl-product-demo.png +0 -0
  70. package/src/clipen/skills/builtin/assets/style-tpl-product-review.png +0 -0
  71. package/src/clipen/skills/builtin/assets/style-tpl-product-unboxing.png +0 -0
  72. package/src/clipen/skills/builtin/assets/style-tpl-shorts-highlight.png +0 -0
  73. package/src/clipen/skills/builtin/assets/style-tpl-travel-highlight.png +0 -0
  74. package/src/clipen/skills/builtin/assets/style-tpl-travel-vlog.png +0 -0
  75. package/src/clipen/skills/builtin/display.en.json +89 -0
  76. package/src/clipen/skills/builtin/references/captions.md +12 -0
  77. package/src/clipen/skills/builtin/references/graphics.md +6 -6
  78. package/src/clipen/skills/builtin/template-skills/clipen-daily-vlog/SKILL.md +9 -4
  79. package/src/clipen/skills/builtin/template-skills/clipen-event-recap/SKILL.md +10 -5
  80. package/src/clipen/skills/builtin/template-skills/clipen-food-review/SKILL.md +9 -4
  81. package/src/clipen/skills/builtin/template-skills/clipen-product-demo/SKILL.md +10 -6
  82. package/src/clipen/skills/builtin/template-skills/clipen-product-review/SKILL.md +10 -6
  83. package/src/clipen/skills/builtin/template-skills/clipen-product-unboxing/SKILL.md +9 -7
  84. package/src/clipen/skills/builtin/template-skills/clipen-shorts-highlight/SKILL.md +10 -5
  85. package/src/clipen/skills/builtin/template-skills/clipen-travel-highlight/SKILL.md +10 -5
  86. package/src/clipen/skills/builtin/template-skills/clipen-travel-vlog/SKILL.md +10 -7
  87. package/src/clipen/skills/catalog.py +22 -8
  88. package/src/clipen/skills/package.py +1 -10
  89. package/src/clipen/terminal.py +344 -0
  90. package/src/clipen/workspace.py +97 -28
  91. package/apps/web/dist/assets/index-C3Zw0WaM.js +0 -14
  92. package/apps/web/dist/assets/index-CaxEZKLc.css +0 -1
  93. package/src/clipen/editing/resolve_titles.py +0 -291
  94. package/src/clipen/rendering/program_creator.py +0 -804
  95. package/src/clipen/rendering/program_identities.py +0 -350
  96. package/src/clipen/rendering/program_motion.py +0 -186
  97. package/src/clipen/rendering/program_studio.py +0 -227
  98. package/src/clipen/rendering/program_styles.py +0 -321
  99. package/src/clipen/skills/builtin/components.json +0 -133
@@ -130,29 +130,15 @@ class FfmpegPreviewRenderer:
130
130
 
131
131
  Rewording, moving or restyling graphics and subtitles leaves this unchanged, so the
132
132
  last few are kept and such an edit only redoes the text layer."""
133
- projects = getattr(self.media, "projects", None)
134
- if projects is None:
133
+ cached = self.media_cache_path(project_id, timeline)
134
+ if cached is None:
135
135
  output = directory / "media.mp4"
136
136
  self._render_media(project_id, timeline, output, cancel, progress)
137
137
  return output
138
- import hashlib
139
- import json
140
- from dataclasses import replace
141
-
142
- picture = replace(
143
- timeline, tracks=tuple(t for t in timeline.tracks if t.kind is not TrackKind.TITLE), markers=()
144
- ).to_payload()
145
- picture.pop("timeline_id", None)
146
- key = hashlib.sha256(
147
- json.dumps(
148
- {"version": 1, "picture": picture, "master": self.master}, sort_keys=True, ensure_ascii=False
149
- ).encode()
150
- ).hexdigest()[:32]
151
- folder = projects.root / project_id / "previews" / "media-cache"
152
- cached = folder / f"{key}.mp4"
153
138
  if cached.is_file():
154
139
  os.utime(cached)
155
140
  return cached
141
+ folder, key = cached.parent, cached.stem
156
142
  output = directory / "media.mp4"
157
143
  self._render_media(project_id, timeline, output, cancel, progress)
158
144
  try:
@@ -169,6 +155,26 @@ class FfmpegPreviewRenderer:
169
155
  pass # A cache that cannot be written only means the next edit renders in full.
170
156
  return output
171
157
 
158
+ def media_cache_path(self, project_id, timeline) -> Path | None:
159
+ """Where the cut without its text layer is kept; it may not have been rendered yet."""
160
+ projects = getattr(self.media, "projects", None)
161
+ if projects is None:
162
+ return None
163
+ import hashlib
164
+ import json
165
+ from dataclasses import replace
166
+
167
+ picture = replace(
168
+ timeline, tracks=tuple(t for t in timeline.tracks if t.kind is not TrackKind.TITLE), markers=()
169
+ ).to_payload()
170
+ picture.pop("timeline_id", None)
171
+ key = hashlib.sha256(
172
+ json.dumps(
173
+ {"version": 1, "picture": picture, "master": self.master}, sort_keys=True, ensure_ascii=False
174
+ ).encode()
175
+ ).hexdigest()[:32]
176
+ return projects.root / project_id / "previews" / "media-cache" / f"{key}.mp4"
177
+
172
178
  def _render_media(self, project_id, timeline, output, cancel, progress, *, preserve_audio_gain=False):
173
179
  from .stage import set_stage
174
180
 
@@ -96,9 +96,17 @@ class TitleCardRenderer:
96
96
  draw_program_component(draw, font_path, timeline, item, self.custom_styles[item.style_id], relative_frame)
97
97
  return
98
98
  if self.custom_styles.get(item.style_id, {}).get("kind") == "program_subtitle":
99
+ profile = self.custom_styles[item.style_id]
100
+ design = self.custom_styles.get(profile.get("design") or "")
101
+ if design:
102
+ from .custom_components import draw_caption
103
+
104
+ draw_caption(draw, timeline, item, design, profile, relative_frame)
105
+ return
106
+ # Captions made before the AI designed them keep their earlier drawing.
99
107
  from .program_subtitles import draw_program_subtitle
100
108
 
101
- draw_program_subtitle(draw, font_path, timeline, item, self.custom_styles[item.style_id], relative_frame)
109
+ draw_program_subtitle(draw, font_path, timeline, item, profile, relative_frame)
102
110
  return
103
111
  if item.style_id in self.custom_styles:
104
112
  profile = self.custom_styles[item.style_id]
@@ -339,30 +347,39 @@ def compose_dense_titles(
339
347
  *(i.start_frame + i.duration_frames for i in items),
340
348
  }
341
349
  )
350
+ from .custom_components import caption_moments, draw_captions
342
351
  from .program_subtitles import animation_boundaries
343
352
 
344
- boundaries = sorted(
345
- set(boundaries)
346
- | {
347
- b
348
- for i in items
349
- if (custom_styles or {}).get(i.style_id, {}).get("kind") == "program_subtitle"
350
- for b in animation_boundaries(i)
351
- }
352
- )
353
+ styles = custom_styles or {}
354
+ subtitles = [i for i in items if styles.get(i.style_id, {}).get("kind") == "program_subtitle"]
355
+ designed = [
356
+ (i, styles[styles[i.style_id]["design"]], styles[i.style_id])
357
+ for i in subtitles
358
+ if styles.get(styles[i.style_id].get("design") or "")
359
+ ]
360
+ boundaries = set(boundaries)
361
+ for item in subtitles:
362
+ design = styles.get(styles[item.style_id].get("design") or "")
363
+ if design:
364
+ boundaries |= {item.start_frame + n for n in caption_moments(design, item.duration_frames)}
365
+ else:
366
+ boundaries |= animation_boundaries(item)
353
367
  from .program_components import animation_boundaries as component_boundaries
354
368
 
355
369
  # Free designs are drawn frame by frame before anything else; after a look change that is
356
370
  # every frame of every graphic, so it reports progress and stops when cancelled.
357
371
  components = [i for i in items if (custom_styles or {}).get(i.style_id, {}).get("kind") == "program_component"]
358
- boundaries = set(boundaries)
359
372
  from .stage import set_stage
360
373
 
374
+ if designed:
375
+ # Captions the AI designed are drawn ahead together, many to a Chrome run.
376
+ set_stage(f"畫字幕 {len(designed)} 句")
377
+ draw_captions(timeline, designed, cancel, lambda value: report(0.1 * value))
361
378
  for count, item in enumerate(components):
362
379
  if cancel.is_set():
363
380
  raise TitleRenderError("cancelled")
364
381
  set_stage(f"畫自由設計元件 {count + 1}/{len(components)}")
365
- report(0.2 * count / len(components))
382
+ report(0.1 + 0.1 * count / len(components))
366
383
  boundaries |= component_boundaries(item, custom_styles[item.style_id], timeline, cancel)
367
384
  boundaries = sorted(boundaries)
368
385
  set_stage("繪製字幕與元件")
@@ -40,7 +40,7 @@ description: Clipen 製作核心:所有影片製作 Skill 共用的取證、
40
40
 
41
41
  - 找事件與安排觀眾資訊時讀 references/story.md。
42
42
  - 選剪點、原音或 B-roll 時讀 references/editing.md;需求要每支素材都出現、或要做快剪蒙太奇時,先讀其中「快剪段落的原音」再排片段。
43
- - 建立/修正字幕時讀 references/captions.md。
43
+ - 建立/修正字幕時讀 references/captions.md;字幕的樣子先用 set_caption_design 設計。
44
44
  - 選曲與混音時讀 references/sound.md。
45
45
  - 做後製畫面時讀 references/graphics.md,再用 list_program_components 讀規格與片中已有的元件。
46
46
  - 比較草稿、修錯與交付前讀 references/review.md。
@@ -58,8 +58,8 @@ read_mutation_receipt 可以查指定操作的結果;先檢查目前版本再
58
58
 
59
59
  所有畫面元件都由你自己設計:用 add_custom_component 寫一個自足的網頁(HTML/CSS/SVG/Canvas/JS),
60
60
  版面、配色、形狀和動態都由你決定;沒有內建模板可套。
61
- 字型由「外觀」管:先用 set_component_look 替每一類元件(例如章節、地點、反應字)定一套字型與配色,
62
- 每個元件用 look_id 指定外觀,字型寫成 var(--look-font-鍵名);同一類元件因此一致,想換字就改外觀,整類一起換。
61
+ 字型與配色完全自由:Mac 上的字型、Clipen 內附字型,或用 get_font 取得 Google Fonts 的開源字型,都能用名稱直接使用。
62
+ 想讓同一類元件一致,可以用 set_component_look 定一套外觀並用 look_id 指定;外觀是選用的。
63
63
  節目感來自在對的瞬間補上畫面與字幕都沒有的東西,不是每段都放一個框。
64
64
  整部片維持一套你自己建立的視覺語言;開場、章節、資訊、反應各有清楚層級。
65
65
  看過該鏡再決定位置,依來源的人臉、動作與資訊安排,不讓每個元件落在同一角。
@@ -0,0 +1,89 @@
1
+ {
2
+ "_about": "English names and descriptions for the built-in skill and templates, shown when the interface reads English. Display only: not part of the frozen skill content.",
3
+ "skills": {
4
+ "travel-program": {
5
+ "name": "People-and-experience travel show",
6
+ "description": "A travel show made from real people, conversation and experience, with consistent captions, info labels, motion and sound."
7
+ }
8
+ },
9
+ "references": {
10
+ "旅遊行程的地名標示、激動句子放大、資訊寫進字幕;轉成 Clipen 原創版面。": "Place names along the route, excited lines made big, facts written into captions; turned into Clipen's own layouts.",
11
+ "左上角地點小標、店名與評價的小字標示、收斂的畫面質感;轉成 Clipen 原創版面。": "A small place label top left, small shop-name and rating tags, a restrained look; turned into Clipen's own layouts.",
12
+ "描邊字幕與黃色重點、貼在人物旁的反應字;轉成 Clipen 原創版面。": "Outlined captions with yellow highlights and reaction words beside people; turned into Clipen's own layouts.",
13
+ "YouTube 頻道": "YouTube channel"
14
+ },
15
+ "templates": {
16
+ "travel-vlog": {
17
+ "name": "Travel vlog", "category": "Travel",
18
+ "description": "Take viewers along in first person: setting off, on the way, arriving, and how it felt.",
19
+ "editorial_direction": "Follow your itinerary and keep the real conversations and reactions on the way; label places, transport and costs only when they help.",
20
+ "design_direction": "Outlined handwritten titles, tape-style “place | English” labels, yellow sticker words only for funny or surprising moments.",
21
+ "music_direction": "Light acoustic guitar or lo-fi beats that step back when people talk.",
22
+ "tags": ["First person", "Itinerary order", "Place labels"]
23
+ },
24
+ "product-unboxing": {
25
+ "name": "Unboxing", "category": "Products",
26
+ "description": "From the box and what is inside to first impressions, so viewers know what they would get.",
27
+ "editorial_direction": "In unboxing order: box, accessories, the product, first use. Specs and prices only from the footage or from you.",
28
+ "design_direction": "A slanted colour-block title to open, specs as black tags beside the product, a starburst reaction only for real surprise.",
29
+ "music_direction": "Clean electronic beats, turned down while unboxing and explaining.",
30
+ "tags": ["Unboxing order", "Spec labels", "First impressions"]
31
+ },
32
+ "travel-highlight": {
33
+ "name": "Travel highlights", "category": "Travel",
34
+ "description": "The whole trip in under three minutes, carried by picture and music.",
35
+ "editorial_direction": "Pick the trip's best and most telling moments and cut to the music; keep only the one or two lines that land.",
36
+ "design_direction": "A widely spaced serif title and thin-line place labels, no stickers, everything fading in slowly so the scenery has the frame.",
37
+ "music_direction": "Music with rises and falls sets the pace; cuts fall on the beat.",
38
+ "tags": ["Music first", "Best shots", "Restrained titles"]
39
+ },
40
+ "food-review": {
41
+ "name": "Food spot", "category": "Travel",
42
+ "description": "Take viewers to one place to eat: why you came, what you ordered, the first bite.",
43
+ "editorial_direction": "Say why you came and what you ordered; keep the first bite and the real reaction whole. Prices and names need a source.",
44
+ "design_direction": "A rounded capsule shop name, price tags beside the food, speech bubbles only when it is really good or surprising.",
45
+ "music_direction": "Light beats, lower while eating and talking.",
46
+ "tags": ["First bite", "Shop and price", "Real reactions"]
47
+ },
48
+ "daily-vlog": {
49
+ "name": "Daily vlog", "category": "Life",
50
+ "description": "The little things in a day, like chatting with a friend.",
51
+ "editorial_direction": "In the order of the day, keep the fun conversations and small moments; pass quickly over empty shots and travel.",
52
+ "design_direction": "A handwritten title with a wavy underline that appears as if written; cute reaction words, but not too many.",
53
+ "music_direction": "Warm lo-fi or acoustic guitar that steps back when people talk.",
54
+ "tags": ["Everyday feel", "Time order", "Easy conversation"]
55
+ },
56
+ "product-demo": {
57
+ "name": "Product demo", "category": "Products",
58
+ "description": "Show step by step how to use a product so viewers can follow and learn.",
59
+ "editorial_direction": "One step at a time in the order you use it; each step says what to do, then shows a clear close-up.",
60
+ "design_direction": "Dark interface-panel titles, keycap “STEP” labels, straight arrows pointing at buttons and screens.",
61
+ "music_direction": "Quiet electronic beats, clearly lower while explaining.",
62
+ "tags": ["Step by step", "Close-ups", "Order of use"]
63
+ },
64
+ "product-review": {
65
+ "name": "Product review", "category": "Products",
66
+ "description": "What it is like after real use: pros, cons, and who it suits.",
67
+ "editorial_direction": "Say what was tested and how, then the pros and the cons, then who it suits. Judgements come only from what the speaker actually experienced in the footage.",
68
+ "design_direction": "Highlighter titles, a tick for each pro and a cross for each con, the verdict as a stamp.",
69
+ "music_direction": "Steady beats, lower while explaining and comparing.",
70
+ "tags": ["Pros and cons", "Real testing", "Verdict"]
71
+ },
72
+ "event-recap": {
73
+ "name": "Event recap", "category": "Events",
74
+ "description": "The highlights of a wedding, party or exhibition, keeping the feel of being there.",
75
+ "editorial_direction": "Follow the event: the opening, the main moments, people's reactions and the close. Keep the key lines of speeches or vows whole.",
76
+ "design_direction": "A gold calligraphic title with fine lines, small time and place labels, names with a thin underline, all fading in elegantly.",
77
+ "music_direction": "Warm piano or strings that stop or drop well down during speeches.",
78
+ "tags": ["Event order", "Key moments", "Atmosphere"]
79
+ },
80
+ "shorts-highlight": {
81
+ "name": "Shorts highlight", "category": "Shorts",
82
+ "description": "A vertical 30–60 second highlight that grabs attention in the first second.",
83
+ "editorial_direction": "Open on the funniest or most striking moment, then quickly give the context; something new every two or three seconds.",
84
+ "design_direction": "Big vertical text with a red and black double outline, neon block labels, key words popping with the lines, large captions.",
85
+ "music_direction": "Brisk music; cuts fall on the beat.",
86
+ "tags": ["Vertical 9:16", "Hook in 1 second", "Fast pace"]
87
+ }
88
+ }
89
+ }
@@ -1,5 +1,17 @@
1
1
  # 字幕
2
2
 
3
+ ## 字幕的樣子由你設計
4
+
5
+ 沒有內建字幕樣式。建立字幕前,先用 set_caption_design 寫一個字幕網頁:
6
+ - 放一個 data-clipen-caption 元素,Clipen 會把每句字幕放進去,重點字包成 `<em>`;
7
+ `<html>` 的 data-delivery 會是 dialogue、punchline 或 quiet,三種語氣自己設計差別。
8
+ - 字型自由選(任何字型名稱,或用 get_font 取得開源字型);長時間閱讀要清楚、不累眼。
9
+ - 動態:預設只畫開頭 entry_frames、結尾 exit_frames(各 0–60 格)和中間一張靜止畫面,輸出快;需要字幕全程動時設 throughout: true(輸出較慢)。
10
+ - 一支片可以有好幾套字幕設計:apply_to_existing: false 不改既有字幕,replace_subtitles 每句可用 design_id 指定設計。
11
+ - 設計配合這支片的風格與使用者需求;換設計會套用到片中所有字幕,換完要輸出預覽看實際效果。
12
+
13
+ ## 內容與時間
14
+
3
15
  保留原話,使用繁體中文呈現。普通對話不逐字彈跳;真正的重點才強調,情緒來自素材。
4
16
  字幕要跟得上實際語音:ASR 句段、字數比例估時、forced alignment 是不同證據。
5
17
  不把長 ASR 視窗平均切給每個字;沒有可靠字詞時間的分頁/摘錄只能當待修草稿。
@@ -27,7 +27,7 @@
27
27
  ## 設計
28
28
 
29
29
  - 整部片建立一套你自己的視覺語言:字體、配色、形狀、動態方式前後一致。章節、地點、人物、資訊、反應各有清楚的層級,同一種角色用同一種樣子。
30
- - 用「外觀」落實這套語言:開始設計前,用 set_component_look 替每一類元件定一套外觀(例如「章節」「地點」「反應字」),每套有 1–3 套字型與最多 6 個顏色,各類可以完全不同。同一類元件用同一個 look_id。
30
+ - 可以用「外觀」落實這套語言:用 set_component_look 替一類元件定一套字型與配色(例如「章節」「地點」「反應字」),同一類用同一個 look_id,想換字時整類一起換。外觀是選用的,單一元件也可以在頁面裡自己決定字型與顏色。
31
31
  - 開場與章節可以大而有份量;資訊標註小而清楚;反應字短促有力,1–1.5 秒。
32
32
  - 位置跟著內容:反應字靠近做出反應的人,指示對準真正的細節,資訊放在不擋主體的空白處。避開臉、手部動作、食物主體與底部字幕。先看這一鏡(sample_source 或 inspect_preview)再決定。
33
33
  - 起點跟著事件:資訊在被提到或第一次看到時出現。長度依閱讀需要決定,不要都用同一個長度。元件從指定鏡頭裡開始,可以延續過剪接點(例如章節標題橫跨幾個鏡頭),但要在影片結束前結束。
@@ -40,9 +40,10 @@
40
40
  - 頁面就是整個畫面(window.clipen.width × height,例如 1920×1080)。只畫元件本身,其餘保持透明,讓素材透出來。用 vw/vh 或依 window.clipen 計算尺寸,不同解析度才會一致。
41
41
  - 時間由 Clipen 控制:CSS 動畫與 Web Animations 會逐格精準播放;用程式畫的話,定義 `window.clipenFrame = (frame, seconds) => {...}`,在裡面畫出那一格。requestAnimationFrame 迴圈、計時器與真實時鐘不會前進。第 0 格是元件出現的第一格,window.clipen 也提供 fps 與 durationFrames。
42
42
  - 沒有網路:圖片與圖形請內嵌(data: URL、inline SVG)。
43
- - 字型只能用元件外觀裡的:寫成 `font-family: var(--look-font-鍵名)`,外觀的顏色是 `var(--look-鍵名)`。用了外觀以外的字型(包括沒指定字型時的瀏覽器預設字)會被擋下。可選的字型列在 list_program_components 的 font_choices:系統字體,加上 Clipen 內附、任何電腦都能用的字型(中文手寫 Clipen Chenyu、楷書筆意 Clipen Iansui;日文手寫 Yusei Magic、Yomogi、Zen Kurenaido、Hachi Maru Pop;日文標題 Dela Gothic One、RocknRoll One、Zen Maru Gothic;英文 Bebas Neue、Anton、Caveat、Playfair Display)。字型缺了元件要顯示的中日文字時,這個字型鍵名的中日文會整組換成同樣感覺、而且字都齊全的下一套字型(例如辰宇遇到日文假名就整組改用 Yomogi),一個詞裡不會混兩種字。想保留自己選的字型,就選字都齊全的那一套;日文為主的元件優先選日文字型。想換字或加一套字,就改外觀;用這個外觀的元件會一起換。改外觀時不要拿掉元件還在用的字型鍵名。
43
+ - 字型完全自由:用字型名稱就能用(`font-family: '名稱'`)。可用的有這台 Mac 安裝的所有字型、Clipen 內附的字型(中文手寫 Clipen Chenyu、楷書筆意 Clipen Iansui;日文手寫 Yusei Magic、Yomogi、Zen Kurenaido、Hachi Maru Pop;日文標題 Dela Gothic One、RocknRoll One、Zen Maru Gothic;英文 Bebas Neue、Anton、Caveat、Playfair Display),以及 Google Fonts 上任何開源字型:先用 get_font 取得(例如 Noto Serif TC、LXGW WenKai TC),之後就能用名稱。用外觀時寫成 `var(--look-font-鍵名)`,缺字會整組換成同感覺且字齊全的字型。選字型前確認它有你要顯示的每個字,繁體中文要選有繁體字的字型。
44
44
  - 標出使用者可以自己改的地方:主要文字放在加了 `data-clipen-text="鍵名"` 的元素裡(可加 `data-clipen-label="主標"` 當顯示名稱),元素內只放純文字;主要顏色寫成 `:root` 上的 `--clipen-名稱` 變數(例如 `--clipen-主色`、`--clipen-字色`),再用 `var(--clipen-主色)` 套用。使用者在審片頁改的字與顏色會在頁面腳本執行前套上;要逐字拆開做動畫時,在 DOMContentLoaded 之後依元素目前的文字拆。沒有標出時,使用者只能請你重做;每個元件都要標。
45
- - 除了字型要來自外觀,只有技術檢查:頁面要能載入、程式不出錯、每格 10 秒內畫完、確實畫出東西、200 KB 以內。
45
+ - 只有技術檢查:頁面要能載入、程式不出錯、每格 10 秒內畫完、確實畫出東西、2 MB 以內。
46
+ - 元件可以跨過剪接點:一個蓋滿畫面、在剪接點附近進出的設計,就是你自己設計的轉場(set_transition 只有黑場、白場)。
46
47
  - 工具會回傳兩張圖:元件停在畫面上的樣子,以及從進場到退場的多格對照(每格標了第幾格)。兩張都要看:字是否清楚、有沒有擋到臉或字幕、是否服務這一刻;動畫是否看得出順序、節奏是否合適、退場是否乾淨。不滿意就用 update_custom_component 改,只需要給要變的欄位。
47
48
  - 同一套視覺語言的元件可以共用同一段 CSS;每個元件仍是一個自足的頁面。
48
49
 
@@ -54,6 +55,5 @@
54
55
 
55
56
  ## 舊作品的元件
56
57
 
57
- 較早的作品可能有用舊內建模板做的元件(list_program_components 的 designed_freely 為 false),或沒有外觀的自由元件(look_id 為空,更新時要指定 look_id)。它們會照常顯示;
58
- 要改它們時,用 remove_program_component 移除,再用 add_custom_component 設計新的。
59
- 自由元件匯出到 DaVinci Resolve 時是圖片,不能在 Resolve 裡改字。
58
+ 較早的作品可能有用已停用的內建模板做的元件(list_program_components 的 designed_freely 為 false)。它們不會出現在影片裡,也不能修改;
59
+ 用 remove_program_component 刪掉,需要的話再用 add_custom_component 設計新的。沒有外觀的自由元件照常顯示。
@@ -15,13 +15,18 @@ description: 日常 vlog 樣板:記錄一天裡發生的小事,語氣輕鬆
15
15
 
16
16
  不需要每段都有轉場;換時間或地點時硬切即可。
17
17
 
18
- ## 字幕與畫面
18
+ ## 字幕與畫面設計
19
+
20
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
19
21
 
20
22
  - 每句口語都要有字幕。
21
- - 開場用 program_title;需要時 detail 寫日期或一句副標。
22
- - 好笑、失手、意外的瞬間才用 reaction 或 impact;不要每句都加。
23
- - 換到新的地點或活動時,可用 chapter 小標(例如「下午|咖啡廳」)。
23
+ - 開場標題:手寫筆跡(辰宇落雁體)深咖啡色,下面一條粉色手繪波浪底線畫出來,再一行副標。
24
+ - 時段地點:換地點或活動時,左上角手寫小標「下午|廚房」,前面一個粉色圓點。
25
+ - 資訊:材料、步驟、價格這類小資訊寫在微微歪斜的黃色便利貼上,像隨手記下來的。
26
+ - 反應:好笑、失手、意外的瞬間才用粉紅手寫大字加幾筆塗鴉線,不要每句都加。
24
27
  - 元件放在不擋臉的位置。
28
+ - 外觀:辰宇落雁體配蘋方;奶油白、粉紅、深咖啡。
29
+ - 字幕:白字深咖啡描邊,重點字淡粉;溫柔、不搶畫面。
25
30
 
26
31
  ## 聲音
27
32
 
@@ -16,13 +16,18 @@ description: 活動紀錄樣板:婚禮、聚會、展覽等活動的重點回
16
16
 
17
17
  不要把活動流程打亂;也不要編造素材中沒有的情節。
18
18
 
19
- ## 字幕與畫面
19
+ ## 字幕與畫面設計
20
+
21
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
20
22
 
21
23
  - 保留的口語都要有字幕,致詞與誓詞要完整、正確。
22
- - 開場用 program_title:主標寫活動名稱或主角,detail 寫日期。
23
- - 換場地或流程時用 location 小標,例如「台北|晚宴」。
24
- - 人物第一次出現且需要介紹時用 person(名字只用素材或使用者提供的)。
25
- - 反應字非常少用,保持溫暖收斂。
24
+ - 開場標題:主角或活動名稱,置中、字距開,書法感楷體(芫荽)米白色,中間用 Playfair 斜體「&」,下方左右細金線夾著日期。
25
+ - 場地流程:換場地或流程時,上方置中、字距很開的「— 台北 晚宴 —」。
26
+ - 人物介紹:第一次出現且需要介紹時才加,名字只用素材或使用者提供的。
27
+ - 資訊:流程時間用一行細字,緩慢淡入。
28
+ - 反應字非常少用;需要點綴時用 Caveat 手寫「with love」之類的金色小字。
29
+ - 外觀:芫荽配 Playfair Display 與 Caveat;深梅紅、米白、金。
30
+ - 字幕:楷體米白、柔和陰影、不描邊,重點字金色;溫暖收斂。
26
31
 
27
32
  ## 聲音
28
33
 
@@ -15,13 +15,18 @@ description: 美食探店樣板:帶觀眾吃一家店,交代為什麼來、
15
15
  4. 上桌與第一口:餐點特寫、第一口完整保留,接講者真實的反應。
16
16
  5. 吃完的感想:好吃在哪、會不會再來;沒有就安靜收尾。
17
17
 
18
- ## 字幕與畫面
18
+ ## 字幕與畫面設計
19
+
20
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
19
21
 
20
22
  - 每句口語都要有字幕。
21
- - 開場用 program_title:主標寫店或料理,detail 寫一句副標。
22
- - 店名用 location 放左上角;餐點名稱與價格用 fact,放在食物旁邊。
23
- - 第一口之後,講者真心好吃或驚訝時才用 reaction,一支片兩三次就好。
23
+ - 開場標題:店或料理名放在圓角橘色膠囊裡,圓體白字,下方奶油色小卡寫一句副標。
24
+ - 店家標示:左上角白色圓角小標,寫「店名|城市」,前面一個橘色圓點。
25
+ - 價格與品項:做成吊牌或價目卡,放在食物旁邊、不蓋住食物,輕輕晃一下再停住。
26
+ - 反應:第一口之後講者真心好吃或驚訝時,用白色對話框圓體大字,一支片兩三次就好。
24
27
  - 元件不要蓋住食物和講者的嘴。
28
+ - 外觀:Zen Maru Gothic 或 Hachi Maru Pop 配蘋方;橘、奶油白、深咖啡。
29
+ - 字幕:圓體白字深咖啡描邊,重點字橘色。
25
30
 
26
31
  ## 聲音
27
32
 
@@ -16,14 +16,18 @@ description: 產品 demo 樣板:一步一步示範產品怎麼用,讓觀眾
16
16
 
17
17
  不要跳過講者實際做過的步驟,也不要加入素材中沒有的步驟。
18
18
 
19
- ## 字幕與畫面
19
+ ## 字幕與畫面設計
20
+
21
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
20
22
 
21
23
  - 每句口語都要有字幕。
22
- - 開場用 program_title,detail 寫第一步或副標。
23
- - 每一步開始時用 chapter 小標,例如「STEP 1|匯入素材」。
24
- - 需要指出按鍵、選單、接口時用 pointer 或 circle,目標必須準確。
25
- - 設定值、型號、快捷鍵用 fact。
26
- - 很少用 reaction;完成時可以用一次。
24
+ - 開場標題:左側一條青色直線,白色粗體主標加青色「STEP 1 +步驟名」,乾淨的介面感。
25
+ - 步驟標示:每一步開始時更新左上角的「STEP n|步驟名」雙色小標。
26
+ - 指示:要點的按鍵、選單、接口用畫出來的引線加脈衝圓圈指到準確位置,旁邊一個「點這裡」小框;目標必須準確。
27
+ - 設定值、型號、快捷鍵用等寬或清楚的小標註。
28
+ - 完成時可以用一次綠色「✓ 完成」膠囊。
29
+ - 外觀:蘋方粗體配 Bebas Neue 數字;深藍黑底、白、青色,成功用綠色。
30
+ - 字幕:白字放在半透明深色底條上,重點字青色。
27
31
 
28
32
  ## 聲音
29
33
 
@@ -17,14 +17,18 @@ description: 產品評測樣板:實際用過之後的心得,分優點、缺
17
17
 
18
18
  所有評價、分數、比較都只能來自素材裡講者說過或展示過的內容。
19
19
 
20
- ## 字幕與畫面
20
+ ## 字幕與畫面設計
21
+
22
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
21
23
 
22
24
  - 每句口語都要有字幕。
23
- - 開場用 program_title,detail 寫一個問題。
24
- - 每個優點或缺點用 fact 標示,例如「優點|續航很久」「缺點|有點重」。
25
- 以「優點」開頭的會顯示綠色打勾,以「缺點」開頭的會顯示紅色打叉。
26
- - 結論用 headline 大字。
27
- - 講者強烈的反應才用 reaction;impact 整支片最多一次。
25
+ - 開場標題:白底黑字大標加一條綠色底線,下方一行提問(例如「真的值得買嗎?」)。
26
+ - 標示:左上角「REVIEW」黑底小標加評測天數。
27
+ - 優缺點:一條一條滑進來的清單,優點綠底白勾、缺點紅底白叉,後面寫具體內容。
28
+ - 結論:用蓋章感的大字(例如「值得!」),整支片一次。
29
+ - 講者強烈的反應才加大字,克制使用。
30
+ - 外觀:蘋方粗體;白、黑、綠(優點/結論)、紅(缺點)。
31
+ - 字幕:白字黑描邊,重點字綠色。
28
32
 
29
33
  ## 聲音
30
34
 
@@ -18,15 +18,17 @@ description: 產品開箱樣板:依開箱順序介紹外盒、內容物、本
18
18
 
19
19
  不要加入素材中沒有的比較或評分;開箱不是評測。
20
20
 
21
- ## 字幕與畫面
21
+ ## 字幕與畫面設計
22
+
23
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
22
24
 
23
25
  - 每句口語都要有字幕。
24
- - 開場用 program_title 放產品名稱,detail 放一句副標(例如「盒子裡有什麼?」)。
25
- - 品名、型號、規格、價格用 fact;只用包裝、畫面上看得到的字、講者說出口或使用者提供的資訊。
26
- - 需要指出細節(接口、按鍵、材質)時用 pointer 或 circle,目標要準確落在該細節上。
27
- - 換到下一個段落(例如從配件到本體)可用 chapter。
28
- - 講者真心驚訝時才用 reaction;impact 整支片最多一兩次。
29
- - 資訊卡放在產品旁邊的空白處,不要蓋住產品本身。
26
+ - 開場標題:產品名稱放在斜切的亮黃色塊上,黑色超粗字加硬陰影,下方黑底白字一句副標(例如「盒子裡有什麼?」)。
27
+ - 段落標示:左上角黑底小標「開箱 UNBOXING」配一條黃色色條;換段落(配件→本體)時更新。
28
+ - 規格標註:品名、型號、規格、價格放在產品旁的空白處,黑底白字主行加黃底小行,用一條引線指向實際部位;只用包裝、畫面上看得到的字、講者說出口或使用者提供的資訊。
29
+ - 反應字:講者真心驚訝時才用爆炸框大字,整支片一兩次。
30
+ - 外觀:Dela Gothic One 或黑體超粗配蘋方;黑、白、亮黃三色。
31
+ - 字幕:白色粗體黑描邊,重點字黃色。
30
32
 
31
33
  ## 聲音
32
34
 
@@ -21,12 +21,17 @@ description: 短影音精華樣板:直式 9:16、30 到 60 秒的精華短片
21
21
  - 使用直式 9:16 畫布(set_canvas,例如 1080×1920)。
22
22
  - 主體放在畫面中間;元件與字幕避開上方與下方各約 10% 的區域(平台介面會蓋住)。
23
23
 
24
- ## 字幕與畫面
24
+ ## 字幕與畫面設計
25
25
 
26
- - 每句口語都要有字幕,可以比橫式影片大一些。
27
- - 開場用 headline 或 program_title 放一句抓人的大字,置中。
28
- - 重點詞用 reaction 或 impact 跟著台詞跳出,但同一時間只放一個。
29
- - 地點或資訊用 location、fact,簡短。
26
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
27
+
28
+ - 每句口語都要有字幕,可以比橫式影片大一些,放在畫面中下方安全區。
29
+ - 開場:一句抓人的大字置中,紅底白字粗圓體、硬陰影、微微傾斜。
30
+ - 頂部可以有一條細進度條,提醒觀眾還剩多少。
31
+ - 地點:黃底小標「📍 地名」,簡短。
32
+ - 重點詞:跟著台詞跳出的黃色描邊大字,同一時間只放一個。
33
+ - 外觀:RocknRoll One 或 Dela Gothic One 配蘋方;霓虹粉、青、黃與黑描邊。
34
+ - 字幕:白色粗體黑描邊,重點字黃色;節奏快,進場要短。
30
35
 
31
36
  ## 聲音
32
37
 
@@ -16,13 +16,18 @@ description: 旅遊精華樣板:把整趟旅程濃縮成 3 分鐘內、跟著
16
16
 
17
17
  剪點跟著配樂的拍子;同一個地點不要重複放很像的鏡頭。說話只留一兩句最有感的原話,其餘交給畫面與音樂。
18
18
 
19
- ## 字幕與畫面
19
+ ## 字幕與畫面設計
20
+
21
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
20
22
 
21
23
  - 保留的口語都要有字幕。
22
- - 開場用 program_title:主標寫目的地與天數,detail 寫英文或年份。
23
- - 換地點時用 location 標「地名|英文」,放左上角。
24
- - 少用資訊與反應元件;真的很驚豔的瞬間才用一次 reaction。
25
- - 畫面乾淨,不要讓元件蓋住風景。
24
+ - 整體像電影:可以用上下黑邊,畫面乾淨、留白多。
25
+ - 開場標題:目的地與天數,細體、字距很開,下方一條細線與英文斜體(年份或地名)。
26
+ - 地點標示:換地點時在上方黑邊內用置中、字距很開的「— 地名 ENGLISH —」。
27
+ - 資訊標註:座標、氣溫、風速這類安靜的小字,放在角落,緩慢淡入。
28
+ - 反應:不用跳動的大字;真的很驚豔時用一行斜體的「Day 04 / 10」或一句短句收尾。
29
+ - 外觀:細黑體配 Playfair Display 斜體與 Bebas Neue 小字;冷藍灰、白、淡金。
30
+ - 字幕:細體白字加柔和陰影、不描邊,重點字淡金色,放在下方黑邊或畫面下緣。
26
31
 
27
32
  ## 聲音
28
33
 
@@ -16,15 +16,18 @@ description: 旅遊 vlog 樣板:第一人稱帶觀眾走一趟,依行程順
16
16
 
17
17
  依素材的時間順序剪;跳過的時間用硬切或短暫淡轉,不要每一刀都加轉場。
18
18
 
19
- ## 字幕與畫面
19
+ ## 字幕與畫面設計
20
+
21
+ 所有畫面元件和字幕都由你用 add_custom_component 與 set_caption_design 自由設計;下面是這類影片的方向,不是固定版型,依素材與使用者需求調整。
20
22
 
21
23
  - 每句口語都要有字幕。
22
- - 開場用 program_title 放本集主題,detail 放日期或第幾天(有依據才寫)。
23
- - 第一次到一個地點用 location 標地名;店名、站名只在畫面或講者說出口時標。
24
- - 花費、營業時間、交通方式這類資訊用 fact,必須有來源。
25
- - 真的驚訝或好笑的反應才用 impact 或 reaction,一支片三到五次就夠。
26
- - 換一天或換一個城市時才用 chapter。
27
- - 元件放在不擋臉和主要風景的位置,地點條通常在左下。
24
+ - 開場標題:本集主題加日期或第幾天(有依據才寫),手寫感、白字深色描邊,旁邊一行黃色副標。
25
+ - 地點標示:第一次到一個地方時,左上角一張像紙膠帶貼上去的小標,寫「地名|英文」;店名、站名只在畫面或講者說出口時標。
26
+ - 資訊標註:花費、營業時間、交通用一行帶圖示的小膠囊,放在不擋臉的下方,必須有來源。
27
+ - 反應字:真的驚訝或好笑的瞬間,用黃色貼紙感大字加幾條動態線,一支片三到五次就夠。
28
+ - 換一天或換城市時才做章節卡。
29
+ - 外觀:手寫標題(Yusei Magic 或辰宇落雁體)配蘋方;顏色用夕陽暖黃與深藍紫描邊。
30
+ - 字幕:白色粗體、深色描邊,重點字黃色;進場短而輕。
28
31
 
29
32
  ## 聲音
30
33