@clipen/clipen-cli 1.0.0 → 1.0.1

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 (127) hide show
  1. package/README.md +60 -50
  2. package/package.json +7 -4
  3. package/pyproject.toml +18 -2
  4. package/requirements/dev.txt +2 -0
  5. package/src/clipen/__init__.py +1 -1
  6. package/src/clipen/analysis/__init__.py +7 -7
  7. package/src/clipen/analysis/artifacts.py +4 -10
  8. package/src/clipen/analysis/audio.py +10 -8
  9. package/src/clipen/analysis/evidence_service.py +345 -167
  10. package/src/clipen/analysis/image_similarity.py +5 -14
  11. package/src/clipen/analysis/keyframes.py +5 -17
  12. package/src/clipen/analysis/models.py +5 -7
  13. package/src/clipen/analysis/qwen_worker.py +19 -54
  14. package/src/clipen/analysis/resources.py +2 -1
  15. package/src/clipen/analysis/runtime.py +1 -3
  16. package/src/clipen/analysis/service.py +16 -48
  17. package/src/clipen/analysis/setup.py +11 -25
  18. package/src/clipen/analysis/setup_cli.py +5 -15
  19. package/src/clipen/analysis/storage.py +96 -278
  20. package/src/clipen/analysis/transcription.py +40 -82
  21. package/src/clipen/analysis/visual.py +109 -48
  22. package/src/clipen/annotations/__init__.py +5 -2
  23. package/src/clipen/annotations/models.py +1 -1
  24. package/src/clipen/annotations/storage.py +132 -84
  25. package/src/clipen/annotations/suggestions.py +3 -8
  26. package/src/clipen/asr_release.py +4 -11
  27. package/src/clipen/bootstrap.py +65 -54
  28. package/src/clipen/{planning/models.py → candidates.py} +29 -47
  29. package/src/clipen/cli.py +2 -2
  30. package/src/clipen/controller/app.py +401 -214
  31. package/src/clipen/controller/server.py +28 -38
  32. package/src/clipen/domain/__init__.py +1 -1
  33. package/src/clipen/domain/media_time.py +3 -10
  34. package/src/clipen/domain/timeline.py +45 -47
  35. package/src/clipen/domain/validation.py +0 -1
  36. package/src/clipen/editing/__init__.py +1 -1
  37. package/src/clipen/editing/agent_models.py +4 -11
  38. package/src/clipen/editing/agent_repository.py +391 -170
  39. package/src/clipen/editing/agent_tools.py +180 -99
  40. package/src/clipen/editing/alignment.py +92 -52
  41. package/src/clipen/editing/alignment_setup.py +118 -70
  42. package/src/clipen/editing/alignment_worker.py +11 -9
  43. package/src/clipen/editing/change_report.py +95 -38
  44. package/src/clipen/editing/compiler.py +0 -1
  45. package/src/clipen/editing/component_looks.py +58 -34
  46. package/src/clipen/editing/component_review.py +34 -38
  47. package/src/clipen/editing/coordinator.py +213 -90
  48. package/src/clipen/editing/editorial_review.py +217 -95
  49. package/src/clipen/editing/evidence_jobs.py +457 -200
  50. package/src/clipen/editing/history_changes.py +129 -68
  51. package/src/clipen/editing/music_choices.py +8 -5
  52. package/src/clipen/editing/production_catalog.py +573 -136
  53. package/src/clipen/editing/production_limits.py +43 -17
  54. package/src/clipen/editing/production_media.py +376 -167
  55. package/src/clipen/editing/production_preview.py +322 -129
  56. package/src/clipen/editing/production_progress.py +164 -69
  57. package/src/clipen/editing/production_requirements.py +106 -39
  58. package/src/clipen/editing/production_tools.py +1064 -462
  59. package/src/clipen/editing/program_audio.py +211 -81
  60. package/src/clipen/editing/program_direction.py +59 -25
  61. package/src/clipen/editing/program_story.py +83 -45
  62. package/src/clipen/editing/program_subtitles.py +194 -96
  63. package/src/clipen/editing/programme_review.py +98 -50
  64. package/src/clipen/editing/prompt_history.py +64 -27
  65. package/src/clipen/editing/recut.py +65 -25
  66. package/src/clipen/editing/refinement_references.py +176 -86
  67. package/src/clipen/editing/resolve_export.py +449 -218
  68. package/src/clipen/editing/resolve_titles.py +162 -105
  69. package/src/clipen/editing/skill_tools.py +530 -154
  70. package/src/clipen/editing/source_dialogue.py +177 -67
  71. package/src/clipen/editing/speech_coverage.py +42 -22
  72. package/src/clipen/editing/speech_quality.py +6 -1
  73. package/src/clipen/editing/tool_receipts.py +78 -32
  74. package/src/clipen/editing/versions.py +122 -64
  75. package/src/clipen/editing/visual_preview.py +157 -61
  76. package/src/clipen/editing/workbench.py +104 -42
  77. package/src/clipen/finishing/audio.py +69 -30
  78. package/src/clipen/finishing/catalog.py +176 -93
  79. package/src/clipen/finishing/models.py +1 -1
  80. package/src/clipen/finishing/renderer.py +33 -14
  81. package/src/clipen/mcp_editing/__main__.py +3 -1
  82. package/src/clipen/mcp_editing/server.py +77 -34
  83. package/src/clipen/media/__init__.py +3 -3
  84. package/src/clipen/media/discovery.py +7 -20
  85. package/src/clipen/media/models.py +7 -18
  86. package/src/clipen/media/preview.py +14 -24
  87. package/src/clipen/media/probe.py +16 -44
  88. package/src/clipen/media/service.py +6 -19
  89. package/src/clipen/media/storage.py +33 -81
  90. package/src/clipen/music_vocabulary.py +33 -4
  91. package/src/clipen/power.py +8 -3
  92. package/src/clipen/projects/__init__.py +1 -1
  93. package/src/clipen/projects/deletion.py +19 -32
  94. package/src/clipen/projects/finishing_schema.py +3 -1
  95. package/src/clipen/projects/models.py +2 -5
  96. package/src/clipen/projects/picker.py +13 -37
  97. package/src/clipen/projects/service.py +8 -24
  98. package/src/clipen/projects/storage.py +226 -246
  99. package/src/clipen/provider_registry.py +4 -2
  100. package/src/clipen/providers/account.py +86 -35
  101. package/src/clipen/providers/claude.py +59 -25
  102. package/src/clipen/providers/claude_editing.py +14 -7
  103. package/src/clipen/providers/codex.py +73 -118
  104. package/src/clipen/providers/codex_editing.py +2 -2
  105. package/src/clipen/providers/editing_agent.py +19 -17
  106. package/src/clipen/providers/recovery.py +7 -8
  107. package/src/clipen/rendering/cover.py +18 -5
  108. package/src/clipen/rendering/custom_components.py +167 -79
  109. package/src/clipen/rendering/custom_render.py +62 -41
  110. package/src/clipen/rendering/production_effects.py +77 -45
  111. package/src/clipen/rendering/program_components.py +134 -73
  112. package/src/clipen/rendering/program_creator.py +432 -277
  113. package/src/clipen/rendering/program_identities.py +277 -182
  114. package/src/clipen/rendering/program_motion.py +140 -95
  115. package/src/clipen/rendering/program_studio.py +175 -116
  116. package/src/clipen/rendering/program_styles.py +231 -145
  117. package/src/clipen/rendering/program_subtitles.py +71 -34
  118. package/src/clipen/rendering/renderer.py +150 -121
  119. package/src/clipen/rendering/storage.py +9 -22
  120. package/src/clipen/rendering/titles.py +193 -86
  121. package/src/clipen/skills/__init__.py +1 -0
  122. package/src/clipen/skills/catalog.py +151 -55
  123. package/src/clipen/skills/library.py +13 -7
  124. package/src/clipen/skills/package.py +46 -23
  125. package/src/clipen/skills/visual_styles.py +29 -18
  126. package/src/clipen/workspace.py +15 -44
  127. package/src/clipen/planning/__init__.py +0 -9
@@ -2,13 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from dataclasses import dataclass
6
5
  import os
7
6
  import re
8
- from pathlib import Path
9
7
  import subprocess
10
8
  import tempfile
11
9
  import threading
10
+ from dataclasses import dataclass
11
+ from pathlib import Path
12
12
  from typing import Callable, Iterable
13
13
 
14
14
  from clipen.domain import EditTimeline, TextClip, TrackKind
@@ -37,16 +37,11 @@ class TitleCardRenderer:
37
37
  # memory pressure on consumer machines.
38
38
  _MAX_TITLES = 32
39
39
 
40
- def __init__(self,custom_styles=None):
41
- self.custom_styles=custom_styles or {}
40
+ def __init__(self, custom_styles=None):
41
+ self.custom_styles = custom_styles or {}
42
42
 
43
43
  def render(self, timeline: EditTimeline, directory: Path) -> tuple[RenderedTitle, ...]:
44
- items = tuple(
45
- item
46
- for track in timeline.tracks
47
- if track.kind is TrackKind.TITLE
48
- for item in track.items
49
- )
44
+ items = tuple(item for track in timeline.tracks if track.kind is TrackKind.TITLE for item in track.items)
50
45
  if len(items) > self._MAX_TITLES:
51
46
  raise TitleRenderError("preview_title_limit_exceeded")
52
47
  if not items:
@@ -95,29 +90,42 @@ class TitleCardRenderer:
95
90
  self, draw, image_font, font_path: Path, timeline: EditTimeline, item: TextClip, relative_frame=None
96
91
  ) -> None:
97
92
  width, height = timeline.width, timeline.height
98
- if self.custom_styles.get(item.style_id,{}).get('kind')=='program_component':
93
+ if self.custom_styles.get(item.style_id, {}).get("kind") == "program_component":
99
94
  from .program_components import draw_program_component
100
- draw_program_component(draw,font_path,timeline,item,self.custom_styles[item.style_id],relative_frame)
95
+
96
+ draw_program_component(draw, font_path, timeline, item, self.custom_styles[item.style_id], relative_frame)
101
97
  return
102
- if self.custom_styles.get(item.style_id,{}).get('kind')=='program_subtitle':
98
+ if self.custom_styles.get(item.style_id, {}).get("kind") == "program_subtitle":
103
99
  from .program_subtitles import draw_program_subtitle
104
- draw_program_subtitle(draw,font_path,timeline,item,self.custom_styles[item.style_id],relative_frame)
100
+
101
+ draw_program_subtitle(draw, font_path, timeline, item, self.custom_styles[item.style_id], relative_frame)
105
102
  return
106
103
  if item.style_id in self.custom_styles:
107
- profile=self.custom_styles[item.style_id]
108
- size=max(1,round(height*profile['font_size_ratio']))
109
- font=image_font.truetype(str(font_path),size)
110
- maximum=round(width*profile['width_ratio'])
111
- lines=self._wrap(draw,item.text,font,maximum)
112
- line_height=max(1,round(size*1.5));pad=max(1,round(size*.25))
113
- x=round(width*profile['x']);y=round(height*profile['y'])
114
- if y+line_height*len(lines)+pad>height or x+maximum>width:
115
- raise TitleRenderError('preview_text_overflow')
104
+ profile = self.custom_styles[item.style_id]
105
+ size = max(1, round(height * profile["font_size_ratio"]))
106
+ font = image_font.truetype(str(font_path), size)
107
+ maximum = round(width * profile["width_ratio"])
108
+ lines = self._wrap(draw, item.text, font, maximum)
109
+ line_height = max(1, round(size * 1.5))
110
+ pad = max(1, round(size * 0.25))
111
+ x = round(width * profile["x"])
112
+ y = round(height * profile["y"])
113
+ if y + line_height * len(lines) + pad > height or x + maximum > width:
114
+ raise TitleRenderError("preview_text_overflow")
116
115
  for row in lines:
117
- length=draw.textlength(row,font=font)
118
- at=x if profile['align']=='left' else x+(maximum-length)/(2 if profile['align']=='center' else 1)
119
- draw.rounded_rectangle((at-pad,y-pad,at+length+pad,y+line_height),radius=pad,fill=tuple(profile['background_color']))
120
- draw.text((at,y),row,font=font,fill=tuple(profile['text_color']));y+=line_height
116
+ length = draw.textlength(row, font=font)
117
+ at = (
118
+ x
119
+ if profile["align"] == "left"
120
+ else x + (maximum - length) / (2 if profile["align"] == "center" else 1)
121
+ )
122
+ draw.rounded_rectangle(
123
+ (at - pad, y - pad, at + length + pad, y + line_height),
124
+ radius=pad,
125
+ fill=tuple(profile["background_color"]),
126
+ )
127
+ draw.text((at, y), row, font=font, fill=tuple(profile["text_color"]))
128
+ y += line_height
121
129
  return
122
130
  if item.style_id == "title.chapter":
123
131
  size = max(28, round(height * 0.055))
@@ -193,9 +201,7 @@ class TitleCardRenderer:
193
201
  @staticmethod
194
202
  def _text_box(draw, lines: Iterable[str], font, spacing: int) -> tuple[int, int]:
195
203
  boxes = [draw.textbbox((0, 0), line, font=font) for line in lines]
196
- return max(box[2] - box[0] for box in boxes), sum(
197
- box[3] - box[1] for box in boxes
198
- ) + spacing * (len(boxes) - 1)
204
+ return max(box[2] - box[0] for box in boxes), sum(box[3] - box[1] for box in boxes) + spacing * (len(boxes) - 1)
199
205
 
200
206
  @staticmethod
201
207
  def _multiline(draw, origin, lines: Iterable[str], font, fill, font_size: int) -> None:
@@ -236,9 +242,7 @@ class FfmpegTitleCompositor:
236
242
  filters = []
237
243
  previous = "[0:v]"
238
244
  for index, title in enumerate(titles, start=1):
239
- command.extend(
240
- ["-loop", "1", "-t", f"{title.duration_seconds:.6f}", "-i", str(title.path)]
241
- )
245
+ command.extend(["-loop", "1", "-t", f"{title.duration_seconds:.6f}", "-i", str(title.path)])
242
246
  fade = min(0.18, title.duration_seconds / 4)
243
247
  fade_out = max(0.0, title.duration_seconds - fade)
244
248
  filters.append(
@@ -247,22 +251,30 @@ class FfmpegTitleCompositor:
247
251
  f"setpts=PTS+{title.start_seconds:.6f}/TB[title{index}]"
248
252
  )
249
253
  output_label = f"composed{index}"
250
- filters.append(
251
- f"{previous}[title{index}]overlay=0:0:eof_action=pass:shortest=0[{output_label}]"
252
- )
254
+ filters.append(f"{previous}[title{index}]overlay=0:0:eof_action=pass:shortest=0[{output_label}]")
253
255
  previous = f"[{output_label}]"
254
256
  command.extend(
255
257
  [
256
- "-filter_complex", ";".join(filters),
257
- "-map", previous,
258
- "-map", "0:a?",
259
- "-c:v", "libx264",
260
- "-preset", "veryfast",
261
- "-crf", "21",
262
- "-pix_fmt", "yuv420p",
263
- "-c:a", "copy",
264
- "-movflags", "+faststart",
265
- "-progress", "pipe:1",
258
+ "-filter_complex",
259
+ ";".join(filters),
260
+ "-map",
261
+ previous,
262
+ "-map",
263
+ "0:a?",
264
+ "-c:v",
265
+ "libx264",
266
+ "-preset",
267
+ "veryfast",
268
+ "-crf",
269
+ "21",
270
+ "-pix_fmt",
271
+ "yuv420p",
272
+ "-c:a",
273
+ "copy",
274
+ "-movflags",
275
+ "+faststart",
276
+ "-progress",
277
+ "pipe:1",
266
278
  "-nostats",
267
279
  str(output),
268
280
  ]
@@ -297,64 +309,159 @@ class FfmpegTitleCompositor:
297
309
  progress(1.0)
298
310
 
299
311
 
300
- def compose_dense_titles(executable,source,timeline,directory,output,cancel,custom_styles=None,progress=None,hardware=False):
312
+ def compose_dense_titles(
313
+ executable, source, timeline, directory, output, cancel, custom_styles=None, progress=None, hardware=False
314
+ ):
301
315
  """One event-based RGBA stream avoids opening dozens of full-HD inputs.
302
316
 
303
317
  Reports progress while drawing (first 40%) and while FFmpeg overlays the
304
318
  stream (the rest), so a long film never looks stuck at the same number.
305
319
  """
306
- report=progress or (lambda _value:None)
307
- from PIL import Image,ImageDraw,ImageFont
320
+ report = progress or (lambda _value: None)
321
+ from PIL import Image, ImageDraw, ImageFont
322
+
308
323
  from clipen.finishing.audio import run_process
309
- items=[i for t in timeline.tracks if t.kind is TrackKind.TITLE for i in t.items]
310
- if len(items)>(960 if timeline.production_session_id else 96):raise TitleRenderError('preview_title_limit_exceeded')
311
- font=TitleCardRenderer._font_path()
312
- if font is None:raise TitleRenderError('preview_title_font_missing')
313
- renderer=TitleCardRenderer(custom_styles);fps=timeline.frame_rate.numerator/timeline.frame_rate.denominator
314
- boundaries=sorted({0,timeline.duration_frames,*(i.start_frame for i in items),*(i.start_frame+i.duration_frames for i in items)})
324
+
325
+ items = [i for t in timeline.tracks if t.kind is TrackKind.TITLE for i in t.items]
326
+ if len(items) > (960 if timeline.production_session_id else 96):
327
+ raise TitleRenderError("preview_title_limit_exceeded")
328
+ font = TitleCardRenderer._font_path()
329
+ if font is None:
330
+ raise TitleRenderError("preview_title_font_missing")
331
+ renderer = TitleCardRenderer(custom_styles)
332
+ fps = timeline.frame_rate.numerator / timeline.frame_rate.denominator
333
+ boundaries = sorted(
334
+ {
335
+ 0,
336
+ timeline.duration_frames,
337
+ *(i.start_frame for i in items),
338
+ *(i.start_frame + i.duration_frames for i in items),
339
+ }
340
+ )
315
341
  from .program_subtitles import animation_boundaries
316
- boundaries=sorted(set(boundaries)|{b for i in items if (custom_styles or {}).get(i.style_id,{}).get('kind')=='program_subtitle' for b in animation_boundaries(i)})
342
+
343
+ boundaries = sorted(
344
+ set(boundaries)
345
+ | {
346
+ b
347
+ for i in items
348
+ if (custom_styles or {}).get(i.style_id, {}).get("kind") == "program_subtitle"
349
+ for b in animation_boundaries(i)
350
+ }
351
+ )
317
352
  from .program_components import animation_boundaries as component_boundaries
318
- boundaries=sorted(set(boundaries)|{b for i in items if (custom_styles or {}).get(i.style_id,{}).get('kind')=='program_component'
319
- for b in component_boundaries(i,custom_styles[i.style_id],timeline)})
320
- lines=['ffconcat version 1.0'];events=max(1,len(boundaries)-1)
321
- for index,(start,end) in enumerate(zip(boundaries,boundaries[1:])):
322
- if cancel.is_set():raise TitleRenderError('cancelled')
323
- if index%20==0:report(.4*index/events)
324
- image=Image.new('RGBA',(timeline.width,timeline.height),(0,0,0,0));draw=ImageDraw.Draw(image)
353
+
354
+ boundaries = sorted(
355
+ set(boundaries)
356
+ | {
357
+ b
358
+ for i in items
359
+ if (custom_styles or {}).get(i.style_id, {}).get("kind") == "program_component"
360
+ for b in component_boundaries(i, custom_styles[i.style_id], timeline)
361
+ }
362
+ )
363
+ lines = ["ffconcat version 1.0"]
364
+ events = max(1, len(boundaries) - 1)
365
+ for index, (start, end) in enumerate(zip(boundaries, boundaries[1:])):
366
+ if cancel.is_set():
367
+ raise TitleRenderError("cancelled")
368
+ if index % 20 == 0:
369
+ report(0.4 * index / events)
370
+ image = Image.new("RGBA", (timeline.width, timeline.height), (0, 0, 0, 0))
371
+ draw = ImageDraw.Draw(image)
325
372
  for item in items:
326
- if item.start_frame<=start<item.start_frame+item.duration_frames:renderer._draw_card(draw,ImageFont,font,timeline,item,start-item.start_frame)
327
- name=f'text-event-{index}.png';image.save(directory/name)
328
- lines.extend((f"file '{name}'",f'option framerate {timeline.frame_rate.numerator}/{timeline.frame_rate.denominator}',f'duration {(end-start)/fps:.9f}'))
329
- lines.extend((f"file 'text-event-{len(boundaries)-2}.png'",f'option framerate {timeline.frame_rate.numerator}/{timeline.frame_rate.denominator}'))
330
- manifest=directory/'text-events.ffconcat';manifest.write_text('\n'.join(lines)+'\n')
331
- report(.4)
332
- seconds=timeline.duration_frames/fps;progress_file=directory/'overlay-progress.txt'
333
- done=threading.Event()
373
+ if item.start_frame <= start < item.start_frame + item.duration_frames:
374
+ renderer._draw_card(draw, ImageFont, font, timeline, item, start - item.start_frame)
375
+ name = f"text-event-{index}.png"
376
+ image.save(directory / name)
377
+ lines.extend(
378
+ (
379
+ f"file '{name}'",
380
+ f"option framerate {timeline.frame_rate.numerator}/{timeline.frame_rate.denominator}",
381
+ f"duration {(end - start) / fps:.9f}",
382
+ )
383
+ )
384
+ lines.extend(
385
+ (
386
+ f"file 'text-event-{len(boundaries) - 2}.png'",
387
+ f"option framerate {timeline.frame_rate.numerator}/{timeline.frame_rate.denominator}",
388
+ )
389
+ )
390
+ manifest = directory / "text-events.ffconcat"
391
+ manifest.write_text("\n".join(lines) + "\n")
392
+ report(0.4)
393
+ seconds = timeline.duration_frames / fps
394
+ progress_file = directory / "overlay-progress.txt"
395
+ done = threading.Event()
396
+
334
397
  def watch():
335
398
  # FFmpeg rewrites out_time_us in its progress file about twice a second.
336
- while not done.wait(.5):
337
- try:text=progress_file.read_text()
338
- except OSError:continue
339
- times=[int(v) for v in re.findall(r'out_time_us=(\d+)',text)]
340
- if times and seconds>0:report(.4+.6*min(1.,times[-1]/1e6/seconds))
341
- watcher=threading.Thread(target=watch,daemon=True);watcher.start()
399
+ while not done.wait(0.5):
400
+ try:
401
+ text = progress_file.read_text()
402
+ except OSError:
403
+ continue
404
+ times = [int(v) for v in re.findall(r"out_time_us=(\d+)", text)]
405
+ if times and seconds > 0:
406
+ report(0.4 + 0.6 * min(1.0, times[-1] / 1e6 / seconds))
407
+
408
+ watcher = threading.Thread(target=watch, daemon=True)
409
+ watcher.start()
410
+
342
411
  def encode(video):
343
- run_process([executable,'-v','error','-nostdin','-y','-progress',str(progress_file),'-filter_complex_threads','2','-i',str(source),'-f','concat','-safe','0','-i',str(manifest),
344
- '-filter_complex','[0:v][1:v]overlay=eof_action=repeat:format=auto,format=yuv420p[v]',
345
- '-map','[v]','-map','0:a?','-t',str(timeline.duration_frames/fps),'-r',f'{timeline.frame_rate.numerator}/{timeline.frame_rate.denominator}',
346
- *video,'-c:a','copy','-movflags','+faststart',str(output)],cancel,timeout=max(300,round(timeline.duration_frames/fps*3)))
347
- software=['-c:v','libx264','-preset','veryfast','-crf','21']
412
+ run_process(
413
+ [
414
+ executable,
415
+ "-v",
416
+ "error",
417
+ "-nostdin",
418
+ "-y",
419
+ "-progress",
420
+ str(progress_file),
421
+ "-filter_complex_threads",
422
+ "2",
423
+ "-i",
424
+ str(source),
425
+ "-f",
426
+ "concat",
427
+ "-safe",
428
+ "0",
429
+ "-i",
430
+ str(manifest),
431
+ "-filter_complex",
432
+ "[0:v][1:v]overlay=eof_action=repeat:format=auto,format=yuv420p[v]",
433
+ "-map",
434
+ "[v]",
435
+ "-map",
436
+ "0:a?",
437
+ "-t",
438
+ str(timeline.duration_frames / fps),
439
+ "-r",
440
+ f"{timeline.frame_rate.numerator}/{timeline.frame_rate.denominator}",
441
+ *video,
442
+ "-c:a",
443
+ "copy",
444
+ "-movflags",
445
+ "+faststart",
446
+ str(output),
447
+ ],
448
+ cancel,
449
+ timeout=max(300, round(timeline.duration_frames / fps * 3)),
450
+ )
451
+
452
+ software = ["-c:v", "libx264", "-preset", "veryfast", "-crf", "21"]
348
453
  try:
349
454
  if not hardware:
350
455
  encode(software)
351
456
  else:
352
457
  # The Mac's video encoder is about a third faster; any machine that refuses it gets the software path.
353
458
  try:
354
- encode(['-c:v','h264_videotoolbox','-b:v','8000k'])
459
+ encode(["-c:v", "h264_videotoolbox", "-b:v", "8000k"])
355
460
  except Exception:
356
- if cancel.is_set():raise
461
+ if cancel.is_set():
462
+ raise
357
463
  encode(software)
358
464
  finally:
359
- done.set();watcher.join(timeout=2)
360
- report(1.)
465
+ done.set()
466
+ watcher.join(timeout=2)
467
+ report(1.0)
@@ -1,4 +1,5 @@
1
1
  """Versioned production skills, bundled with Clipen or imported by the user, frozen per session."""
2
+
2
3
  from .catalog import configure_library, get_skill, list_skills, skill_library
3
4
 
4
5
  __all__ = ["configure_library", "get_skill", "list_skills", "skill_library"]