@auscera/cleoedits 0.0.0-stage → 0.1.0
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.
- package/README.md +62 -2
- package/cli.mjs +149 -0
- package/lib/dependencies.mjs +384 -0
- package/lib/run.mjs +114 -0
- package/lib/workspace.mjs +167 -0
- package/package.json +240 -3
- package/workspace/.agents/skills/cleoedits/SKILL.md +29 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/audiogram.json +41 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/facebook.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/linkedin.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/podcast.json +23 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/reels.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/shorts.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/tiktok.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/x.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube-shorts.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube.json +48 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/LICENSE-SimpleIcons +30 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/logos.json +1 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Anton-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/ArchivoBlack-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/InstrumentSerif-Italic.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Inter.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/LICENSE-PermanentMarker.txt +202 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Montserrat.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Anton.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-ArchivoBlack.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-InstrumentSerif.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Inter.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Montserrat.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Poppins.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-SpaceMono.txt +93 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PermanentMarker-Regular.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay-Italic.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Black.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Bold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-ExtraBold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/SpaceMono-Bold.ttf +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-MediaPipe +218 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-YuNet +21 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/NOTICE.md +4 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/selfie_segmenter.tflite +0 -0
- package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/yunet.onnx +0 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/LICENSE +21 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/audio-app-ui/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/STYLE.md +53 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/index.html +328 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/index.html +575 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/design-app-ui/STYLE.md +68 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editor-ui/STYLE.md +73 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/STYLE.md +54 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/index.html +189 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/STYLE.md +64 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/index.html +620 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/STYLE.md +55 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/index.html +238 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/STYLE.md +66 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/index.html +602 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/STYLE.md +66 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/index.html +777 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/STYLE.md +56 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/index.html +186 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/motion-app-ui/STYLE.md +68 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/STYLE.md +56 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/index.html +244 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/STYLE.md +67 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/index.html +663 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/STYLE.md +59 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/index.html +395 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/STYLE.md +52 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/index.html +194 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/STYLE.md +58 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/index.html +242 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/STYLE.md +53 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/index.html +138 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/studio.js +57 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/STYLE.md +63 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/index.html +599 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/STYLE.md +65 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/index.html +1297 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/STYLE.md +69 -0
- package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/index.html +674 -0
- package/workspace/.agents/skills/cleoedits/references/audio-clearervoice-elevenlabs.md +11 -0
- package/workspace/.agents/skills/cleoedits/references/ffmpeg-and-reels.md +15 -0
- package/workspace/.agents/skills/cleoedits/references/hyperframes-workflows.md +13 -0
- package/workspace/.agents/skills/cleoedits/references/kdenlive-cli-and-mcp.md +12 -0
- package/workspace/.agents/skills/cleoedits/references/motion-design-pipeline.md +7 -0
- package/workspace/.agents/skills/cleoedits/references/motion-taste-emil.md +5 -0
- package/workspace/.agents/skills/cleoedits/references/playwright-demo-capture.md +9 -0
- package/workspace/.agents/skills/cleoedits/references/remotion-workflows.md +13 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/LICENSE +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_ass_overlay.py +399 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/__init__.py +235 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/alpha.py +560 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/asr.py +1237 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/color.py +540 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/decision.py +2452 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/drawtext.py +290 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emit.py +1309 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emoji.py +518 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/fonts.py +875 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing.py +263 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing_edit.py +432 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/probe.py +1613 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/runner.py +3994 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/text.py +73 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/timeline.py +721 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/wrap.py +981 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_contract.py +2454 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_platforms.py +258 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.html +754 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.py +258 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_smartcut.py +450 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/audio.py +867 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/background.py +136 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/batch.py +1409 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/broll.py +282 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/caption.py +2207 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/check.py +815 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/color.py +695 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/crop.py +91 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cropdetect.py +214 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cut.py +2076 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/deinterlace.py +90 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/denoise.py +94 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/export.py +1033 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/fit.py +729 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/freeze.py +197 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/graphics.py +920 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/grid.py +235 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/insert.py +142 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/join.py +1083 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/look.py +475 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loop.py +395 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loudness.py +397 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/metadata.py +416 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/multicam.py +414 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/overlay.py +766 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/pad.py +121 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/probe.py +145 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/proxy.py +93 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/redact.py +162 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/render.py +2424 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/report.py +354 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/reverse.py +114 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/scenes.py +439 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sequence.py +285 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/silence.py +945 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/speedramp.py +193 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sphere.py +137 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/stabilize.py +141 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/straighten.py +120 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sync.py +500 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/verify.py +411 -0
- package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/waveform.py +502 -0
- package/workspace/.agents/skills/cleoedits/scripts/kdenlive_builder.py +284 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-claude-motion +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-motion-design +21 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/_media.py +43 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/pacing_check.py +90 -0
- package/workspace/.agents/skills/cleoedits/scripts/motion/storyboard.py +77 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/LICENSE +26 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/fx.py +2717 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/logos.py +194 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/sfx.py +105 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/trim.py +99 -0
- package/workspace/.agents/skills/cleoedits/scripts/reel_effects/words.py +60 -0
- package/workspace/.claude/commands/blender-3d.md +12 -0
- package/workspace/.claude/commands/business-short-form-reels.md +12 -0
- package/workspace/.claude/commands/color-grade.md +12 -0
- package/workspace/.claude/commands/cutout-grid-reel.md +12 -0
- package/workspace/.claude/commands/depth-ui-reel.md +12 -0
- package/workspace/.claude/commands/explainer-panel-reel.md +12 -0
- package/workspace/.claude/commands/freeze-frame.md +12 -0
- package/workspace/.claude/commands/glass-graph.md +12 -0
- package/workspace/.claude/commands/over-the-shoulder.md +12 -0
- package/workspace/.claude/commands/personal-short-form-reels.md +12 -0
- package/workspace/.claude/commands/ranking-format.md +12 -0
- package/workspace/.claude/commands/relight.md +12 -0
- package/workspace/.claude/commands/reverse-engineer.md +12 -0
- package/workspace/.claude/commands/text-behind.md +12 -0
- package/workspace/.claude/commands/tier-list.md +12 -0
- package/workspace/.claude-plugin/plugin.json +8 -0
- package/workspace/.npmignore +15 -0
- package/workspace/AGENTS.md +30 -0
- package/workspace/README.md +63 -0
- package/workspace/assets/fonts/TikTokSans-OFL.txt +93 -0
- package/workspace/assets/fonts/TikTokSans-Variable.ttf +0 -0
- package/workspace/assets/luts/clean_warm.cube +4917 -0
- package/workspace/assets/luts/golden_hour.cube +4917 -0
- package/workspace/assets/luts/moody_dark.cube +4917 -0
- package/workspace/assets/luts/teal_orange.cube +4917 -0
- package/workspace/assets/sfx/NOTICE.txt +1 -0
- package/workspace/assets/sfx/click.wav +0 -0
- package/workspace/assets/sfx/pop.wav +0 -0
- package/workspace/assets/sfx/riser.wav +0 -0
- package/workspace/assets/sfx/whoosh.wav +0 -0
- package/workspace/generators/hyperframes/index.html +39 -0
- package/workspace/generators/hyperframes/package.json +15 -0
- package/workspace/generators/hyperframes/pnpm-lock.yaml +1181 -0
- package/workspace/generators/hyperframes/pnpm-workspace.yaml +10 -0
- package/workspace/generators/remotion/eslint.config.mjs +3 -0
- package/workspace/generators/remotion/package.json +36 -0
- package/workspace/generators/remotion/pnpm-lock.yaml +4179 -0
- package/workspace/generators/remotion/pnpm-workspace.yaml +10 -0
- package/workspace/generators/remotion/remotion.config.ts +13 -0
- package/workspace/generators/remotion/src/Root.tsx +52 -0
- package/workspace/generators/remotion/src/index.css +1 -0
- package/workspace/generators/remotion/src/index.ts +4 -0
- package/workspace/generators/remotion/tsconfig.json +15 -0
- package/workspace/pipeline/scripts/_codec.py +28 -0
- package/workspace/pipeline/scripts/ai_media_api.py +109 -0
- package/workspace/pipeline/scripts/blender_render.py +166 -0
- package/workspace/pipeline/scripts/composite.py +49 -0
- package/workspace/pipeline/scripts/melt.sh +68 -0
- package/workspace/pipeline/scripts/normalize_audio.py +39 -0
- package/workspace/pipeline/scripts/person_matte.py +216 -0
- package/workspace/pipeline/scripts/record_demo.py +69 -0
- package/workspace/pipeline/scripts/whisper_cut.py +98 -0
- package/workspace-manifest.json +908 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"""Real brand logos for the logo-link effect.
|
|
2
|
+
|
|
3
|
+
The bundled set (assets/logos.json) comes from Simple Icons (simpleicons.org, CC0 1.0); the logos themselves
|
|
4
|
+
are trademarks of their owners. This file draws their SVG paths with a tiny rasteriser, so nothing extra
|
|
5
|
+
needs installing. Brands that are not in the set can be passed as your own PNG/JPG file instead.
|
|
6
|
+
"""
|
|
7
|
+
import json, math, os, re
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
from PIL import Image
|
|
11
|
+
|
|
12
|
+
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'assets', 'reel_effects'))
|
|
13
|
+
_NUM = re.compile(r'[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?')
|
|
14
|
+
ALIAS = {'gemini': 'googlegemini', 'chrome': 'googlechrome', 'drive': 'googledrive', 'sheets': 'googlesheets',
|
|
15
|
+
'docs': 'googledocs', 'calendar': 'googlecalendar', 'meet': 'googlemeet', 'mistral': 'mistralai',
|
|
16
|
+
'hf': 'huggingface', 'twitter': 'x', 'firefox': 'firefoxbrowser', 'claudecode': 'claude', 'claudeai': 'claude',
|
|
17
|
+
'gcp': 'googlecloud', 'node': 'nodedotjs', 'nodejs': 'nodedotjs', 'next': 'nextdotjs', 'nextjs': 'nextdotjs',
|
|
18
|
+
'tailwind': 'tailwindcss', 'postgres': 'postgresql', 'davinci': 'davinciresolve', 'resolve': 'davinciresolve',
|
|
19
|
+
'colab': 'googlecolab', 'ig': 'instagram', 'insta': 'instagram', 'yt': 'youtube', 'fb': 'facebook',
|
|
20
|
+
'wa': 'whatsapp', 'gh': 'github', 'metaai': 'meta', 'llama': 'meta', 'elevenlabsio': 'elevenlabs'}
|
|
21
|
+
_DATA = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def data():
|
|
25
|
+
global _DATA
|
|
26
|
+
if _DATA is None:
|
|
27
|
+
try: _DATA = json.load(open(os.path.join(ROOT, 'assets', 'logos.json')))['icons']
|
|
28
|
+
except Exception: _DATA = {}
|
|
29
|
+
return _DATA
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def norm(s): return re.sub(r'[^a-z0-9]', '', s.lower().replace('+', 'plus').replace('.', 'dot'))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def find(name):
|
|
36
|
+
"""Look a brand up by slug, title or alias. Returns (slug, entry) or (None, None)."""
|
|
37
|
+
icons = data(); k = norm(name)
|
|
38
|
+
k2 = re.sub(r'[^a-z0-9]', '', name.lower())
|
|
39
|
+
for key in (k, k2, ALIAS.get(k), ALIAS.get(k2)):
|
|
40
|
+
if key and key in icons: return key, icons[key]
|
|
41
|
+
for slug, v in icons.items():
|
|
42
|
+
if norm(v['title']) in (k, k2) or any(norm(a) in (k, k2) for a in v.get('aka', [])): return slug, v
|
|
43
|
+
return None, None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class _Scan:
|
|
47
|
+
def __init__(self, d): self.d, self.i = d, 0
|
|
48
|
+
def skip(self):
|
|
49
|
+
while self.i < len(self.d) and self.d[self.i] in ' ,\t\n\r': self.i += 1
|
|
50
|
+
def cmd(self):
|
|
51
|
+
self.skip()
|
|
52
|
+
if self.i < len(self.d) and self.d[self.i].isalpha():
|
|
53
|
+
self.i += 1; return self.d[self.i - 1]
|
|
54
|
+
return None
|
|
55
|
+
def more(self):
|
|
56
|
+
self.skip(); return self.i < len(self.d) and not self.d[self.i].isalpha()
|
|
57
|
+
def num(self):
|
|
58
|
+
self.skip(); m = _NUM.match(self.d, self.i)
|
|
59
|
+
if not m: raise ValueError(f'bad path data at {self.i}')
|
|
60
|
+
self.i = m.end(); return float(m.group())
|
|
61
|
+
def flag(self):
|
|
62
|
+
self.skip(); ch = self.d[self.i]; self.i += 1; return ch == '1'
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _arc(x1, y1, rx, ry, phi, fa, fs, x2, y2):
|
|
66
|
+
if rx == 0 or ry == 0 or (x1 == x2 and y1 == y2): return [(x2, y2)]
|
|
67
|
+
cp, sp = math.cos(math.radians(phi)), math.sin(math.radians(phi))
|
|
68
|
+
dx, dy = (x1 - x2) / 2, (y1 - y2) / 2
|
|
69
|
+
x1p, y1p = cp * dx + sp * dy, -sp * dx + cp * dy
|
|
70
|
+
rx, ry = abs(rx), abs(ry)
|
|
71
|
+
lam = x1p ** 2 / rx ** 2 + y1p ** 2 / ry ** 2
|
|
72
|
+
if lam > 1: s = math.sqrt(lam); rx, ry = rx * s, ry * s
|
|
73
|
+
num = rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p
|
|
74
|
+
den = rx * rx * y1p * y1p + ry * ry * x1p * x1p
|
|
75
|
+
co = math.sqrt(max(0.0, num / den)) if den else 0.0
|
|
76
|
+
if fa == fs: co = -co
|
|
77
|
+
cxp, cyp = co * rx * y1p / ry, -co * ry * x1p / rx
|
|
78
|
+
cx, cy = cp * cxp - sp * cyp + (x1 + x2) / 2, sp * cxp + cp * cyp + (y1 + y2) / 2
|
|
79
|
+
ang = lambda ux, uy, vx, vy: math.atan2(ux * vy - uy * vx, ux * vx + uy * vy)
|
|
80
|
+
t1 = ang(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry)
|
|
81
|
+
dt = ang((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry)
|
|
82
|
+
if not fs and dt > 0: dt -= 2 * math.pi
|
|
83
|
+
elif fs and dt < 0: dt += 2 * math.pi
|
|
84
|
+
n = max(4, int(abs(dt) / (math.pi / 16)))
|
|
85
|
+
return [(cp * rx * math.cos(t1 + dt * i / n) - sp * ry * math.sin(t1 + dt * i / n) + cx,
|
|
86
|
+
sp * rx * math.cos(t1 + dt * i / n) + cp * ry * math.sin(t1 + dt * i / n) + cy) for i in range(1, n + 1)]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def polygons(d, steps=14):
|
|
90
|
+
"""Flatten SVG path data into closed polygons (lists of points)."""
|
|
91
|
+
s = _Scan(d); polys, cur = [], []
|
|
92
|
+
x = y = sx = sy = 0.0; cx2 = cy2 = None; last = ''
|
|
93
|
+
def bez(p, n=steps):
|
|
94
|
+
out = []
|
|
95
|
+
for i in range(1, n + 1):
|
|
96
|
+
t = i / n; u = 1 - t
|
|
97
|
+
if len(p) == 4:
|
|
98
|
+
out.append((u ** 3 * p[0][0] + 3 * u * u * t * p[1][0] + 3 * u * t * t * p[2][0] + t ** 3 * p[3][0],
|
|
99
|
+
u ** 3 * p[0][1] + 3 * u * u * t * p[1][1] + 3 * u * t * t * p[2][1] + t ** 3 * p[3][1]))
|
|
100
|
+
else:
|
|
101
|
+
out.append((u * u * p[0][0] + 2 * u * t * p[1][0] + t * t * p[2][0], u * u * p[0][1] + 2 * u * t * p[1][1] + t * t * p[2][1]))
|
|
102
|
+
return out
|
|
103
|
+
cmd = None
|
|
104
|
+
while True:
|
|
105
|
+
c = s.cmd()
|
|
106
|
+
if c is None:
|
|
107
|
+
if cmd is None or not s.more(): break
|
|
108
|
+
c = {'M': 'L', 'm': 'l'}.get(cmd, cmd)
|
|
109
|
+
cmd = c; rel = c.islower(); C = c.upper()
|
|
110
|
+
if C == 'Z':
|
|
111
|
+
if cur: polys.append(cur); cur = []
|
|
112
|
+
x, y = sx, sy; last = 'Z'; continue
|
|
113
|
+
first = True
|
|
114
|
+
while first or s.more():
|
|
115
|
+
first = False
|
|
116
|
+
ox, oy = (x, y) if rel else (0.0, 0.0)
|
|
117
|
+
if C == 'M':
|
|
118
|
+
x, y = s.num() + ox, s.num() + oy
|
|
119
|
+
if cur: polys.append(cur)
|
|
120
|
+
cur = [(x, y)]; sx, sy = x, y; C = 'L'; cmd = 'l' if rel else 'L'; last = 'M'; continue
|
|
121
|
+
if not cur: cur = [(x, y)]
|
|
122
|
+
if C == 'L': x, y = s.num() + ox, s.num() + oy; cur.append((x, y))
|
|
123
|
+
elif C == 'H': x = s.num() + ox; cur.append((x, y))
|
|
124
|
+
elif C == 'V': y = s.num() + oy; cur.append((x, y))
|
|
125
|
+
elif C in 'CS':
|
|
126
|
+
if C == 'C': x1, y1 = s.num() + ox, s.num() + oy
|
|
127
|
+
else: x1, y1 = (2 * x - cx2, 2 * y - cy2) if last in 'CS' and cx2 is not None else (x, y)
|
|
128
|
+
x2_, y2_ = s.num() + ox, s.num() + oy; ex, ey = s.num() + ox, s.num() + oy
|
|
129
|
+
cur += bez([(x, y), (x1, y1), (x2_, y2_), (ex, ey)]); cx2, cy2 = x2_, y2_; x, y = ex, ey
|
|
130
|
+
elif C in 'QT':
|
|
131
|
+
if C == 'Q': x1, y1 = s.num() + ox, s.num() + oy
|
|
132
|
+
else: x1, y1 = (2 * x - cx2, 2 * y - cy2) if last in 'QT' and cx2 is not None else (x, y)
|
|
133
|
+
ex, ey = s.num() + ox, s.num() + oy
|
|
134
|
+
cur += bez([(x, y), (x1, y1), (ex, ey)]); cx2, cy2 = x1, y1; x, y = ex, ey
|
|
135
|
+
elif C == 'A':
|
|
136
|
+
rx, ry, phi = s.num(), s.num(), s.num(); fa, fs = s.flag(), s.flag()
|
|
137
|
+
ex, ey = s.num() + ox, s.num() + oy
|
|
138
|
+
cur += _arc(x, y, rx, ry, phi, fa, fs, ex, ey); x, y = ex, ey
|
|
139
|
+
last = C
|
|
140
|
+
if cur: polys.append(cur)
|
|
141
|
+
return polys
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def raster(polys, size, ss=4, view=24.0):
|
|
145
|
+
"""Fill polygons with the SVG non-zero rule into an anti-aliased size x size mask."""
|
|
146
|
+
S = size * ss; sc = S / view; edges = []
|
|
147
|
+
for p in polys:
|
|
148
|
+
q = p + [p[0]]
|
|
149
|
+
for (x0, y0), (x1, y1) in zip(q[:-1], q[1:]):
|
|
150
|
+
if y0 != y1: edges.append((x0 * sc, y0 * sc, x1 * sc, y1 * sc))
|
|
151
|
+
img = np.zeros((S, S), np.uint8)
|
|
152
|
+
if edges:
|
|
153
|
+
x0, y0, x1, y1 = np.array(edges, np.float64).T
|
|
154
|
+
wind = np.where(y1 > y0, 1, -1); ymin, ymax = np.minimum(y0, y1), np.maximum(y0, y1)
|
|
155
|
+
for row in range(S):
|
|
156
|
+
yc = row + 0.5; act = (ymin <= yc) & (ymax > yc)
|
|
157
|
+
if not act.any(): continue
|
|
158
|
+
xi = x0[act] + (yc - y0[act]) * (x1[act] - x0[act]) / (y1[act] - y0[act])
|
|
159
|
+
o = np.argsort(xi); xi = xi[o]; cw = np.cumsum(wind[act][o])
|
|
160
|
+
for k in np.nonzero(cw[:-1] != 0)[0]:
|
|
161
|
+
a, b = int(math.ceil(xi[k] - 0.5)), int(math.floor(xi[k + 1] - 0.5))
|
|
162
|
+
if b >= a: img[row, max(0, a):min(S, b + 1)] = 255
|
|
163
|
+
return Image.fromarray(img).resize((size, size), Image.BOX)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def hex_rgb(h): h = h.lstrip('#'); return tuple(int(h[i:i + 2], 16) for i in (0, 2, 4))
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def logo_image(name, size, color=None):
|
|
170
|
+
"""RGBA logo of `name` (a brand name, or a path to your own PNG/JPG), or None if unknown."""
|
|
171
|
+
if os.path.exists(name):
|
|
172
|
+
im = Image.open(name).convert('RGBA'); s = size / max(im.size)
|
|
173
|
+
return im.resize((max(1, int(im.width * s)), max(1, int(im.height * s))), Image.LANCZOS)
|
|
174
|
+
slug, v = find(name)
|
|
175
|
+
if not v: return None
|
|
176
|
+
mask = raster(polygons(v['path']), size)
|
|
177
|
+
im = Image.new('RGBA', (size, size), (color or hex_rgb(v['hex'])) + (255,)); im.putalpha(mask)
|
|
178
|
+
return im
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def brand_color(name):
|
|
182
|
+
slug, v = find(name) if name else (None, None)
|
|
183
|
+
return hex_rgb(v['hex']) if v else None
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def title(name):
|
|
187
|
+
slug, v = find(name)
|
|
188
|
+
return v['title'] if v else name
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
if __name__ == '__main__':
|
|
192
|
+
icons = data()
|
|
193
|
+
print(f'{len(icons)} bundled logos:')
|
|
194
|
+
print(', '.join(sorted(v['title'] for v in icons.values())))
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""Soft, original sound effects made with numpy: no sample files and no licences to worry about.
|
|
2
|
+
|
|
3
|
+
Each effect gets a small sound when it lands (a pop, tick, whoosh or low impact). They are kept quiet and
|
|
4
|
+
restrained on purpose: a pop on big words and cards, ticks on checks, one low hit on stamps and drops,
|
|
5
|
+
and no whoosh on every cut.
|
|
6
|
+
"""
|
|
7
|
+
import wave
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
|
|
11
|
+
SR = 48000
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _env(n, attack, decay):
|
|
15
|
+
t = np.arange(n) / SR
|
|
16
|
+
return np.minimum(1.0, t / max(attack, 1e-4)) * np.exp(-t / decay)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _lowpass(x, cutoff):
|
|
20
|
+
"""One-pole low-pass with a per-sample cutoff (Hz)."""
|
|
21
|
+
a = np.exp(-2 * np.pi * np.broadcast_to(cutoff, x.shape) / SR); y = np.empty_like(x); p = 0.0
|
|
22
|
+
for i in range(len(x)): p = (1 - a[i]) * x[i] + a[i] * p; y[i] = p
|
|
23
|
+
return y
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def pop():
|
|
27
|
+
n = int(0.09 * SR); t = np.arange(n) / SR
|
|
28
|
+
f = 240 + 820 * np.exp(-t / 0.012)
|
|
29
|
+
s = np.sin(2 * np.pi * np.cumsum(f) / SR) * _env(n, 0.0015, 0.028)
|
|
30
|
+
s += np.random.default_rng(1).standard_normal(n) * _env(n, 0.0004, 0.003) * 0.12
|
|
31
|
+
return s * 0.5
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def tick():
|
|
35
|
+
n = int(0.035 * SR); t = np.arange(n) / SR
|
|
36
|
+
s = np.sin(2 * np.pi * 2400 * t) * _env(n, 0.0004, 0.006) + np.sin(2 * np.pi * 4800 * t) * _env(n, 0.0003, 0.003) * 0.35
|
|
37
|
+
return s * 0.32
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def whoosh(dur=0.36):
|
|
41
|
+
n = int(dur * SR); t = np.linspace(0, 1, n)
|
|
42
|
+
y = _lowpass(np.random.default_rng(2).standard_normal(n), 300 + 4200 * np.sin(np.pi * t) ** 2)
|
|
43
|
+
y = y / (np.abs(y).max() + 1e-9)
|
|
44
|
+
return y * np.sin(np.pi * t) ** 1.6 * 0.32
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def impact():
|
|
48
|
+
n = int(0.5 * SR); t = np.arange(n) / SR
|
|
49
|
+
f = 46 + 75 * np.exp(-t / 0.045)
|
|
50
|
+
s = np.sin(2 * np.pi * np.cumsum(f) / SR) * _env(n, 0.002, 0.15)
|
|
51
|
+
nz = _lowpass(np.random.default_rng(3).standard_normal(n), 900.0) * _env(n, 0.001, 0.03)
|
|
52
|
+
s = s + nz / (np.abs(nz).max() + 1e-9) * 0.25
|
|
53
|
+
return s / (np.abs(s).max() + 1e-9) * 0.62
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
SOUNDS = {'pop': pop, 'tick': tick, 'whoosh': whoosh, 'impact': impact}
|
|
57
|
+
|
|
58
|
+
# what each effect sounds like when it lands: (seconds into the effect, sound, loudness)
|
|
59
|
+
DEFAULT = [(0.0, 'pop', 0.8)]
|
|
60
|
+
SILENT = ('captions', 'lean-in', 'slow-push', 'moody', 'wave-trim', 'rabbit-hole')
|
|
61
|
+
MAP = {
|
|
62
|
+
'reject-stamp': [(0.06, 'impact', 0.9)], 'backdrop-word': [(0.3, 'impact', 0.6)], 'spotlight': [(0.0, 'impact', 0.65)],
|
|
63
|
+
'led-sign': [(0.0, 'impact', 0.55)], 'pop-word': [(0.0, 'pop', 0.8), (0.02, 'impact', 0.45)],
|
|
64
|
+
'red-collage': [(0.0, 'impact', 0.6)], 'match-cut': [(0.0, 'impact', 0.5)], 'huge-strike': [(0.0, 'pop', 0.6)],
|
|
65
|
+
'locked-on': [(0.0, 'tick', 0.9), (0.16, 'tick', 0.7)], 'swipe': [(0.0, 'whoosh', 0.7)],
|
|
66
|
+
'card-drop': [(0.0, 'whoosh', 0.55), (0.12, 'pop', 0.75)], 'split-headline': [(0.0, 'whoosh', 0.55)],
|
|
67
|
+
'reel-frame': [(0.0, 'whoosh', 0.5)], 'halftone-paper': [(0.0, 'whoosh', 0.55)], 'dot-reveal': [(0.0, 'whoosh', 0.5)],
|
|
68
|
+
'uninstall': [(0.0, 'impact', 0.45)], 'over-the-shoulder-zoom': [(0.0, 'pop', 0.6)],
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def events(fx, start, end, opts):
|
|
73
|
+
"""Sound events for one effect as (time, sound, loudness)."""
|
|
74
|
+
if fx in SILENT: return []
|
|
75
|
+
d = end - start; ev = list(MAP.get(fx, DEFAULT))
|
|
76
|
+
if fx in ('todo', 'apple-toggles') and opts.get('ticks'):
|
|
77
|
+
ev = [(float(t) - start, 'tick', 0.9) for t in str(opts['ticks']).split('|') if t.strip()]
|
|
78
|
+
elif fx in ('checklist', 'todo', 'apple-toggles'):
|
|
79
|
+
n = max(1, len(str(opts.get('text', 'a|b|c')).split('|'))); ev = [(0.0, 'pop', 0.6)] + [((i + 1) * d / (n + 1), 'tick', 0.85) for i in range(n)]
|
|
80
|
+
elif fx == 'countdown-flip':
|
|
81
|
+
ev = [(float(i) * d / 3, 'tick', 1.0) for i in range(3)]
|
|
82
|
+
elif fx == 'tap':
|
|
83
|
+
ev = [(0.0, 'pop', 0.6), (float(opts['at']) - start if opts.get('at') else d * 0.5, 'tick', 1.0)]
|
|
84
|
+
elif fx == 'huge-strike':
|
|
85
|
+
ev = [(0.0, 'pop', 0.6), (float(opts.get('at', 0.6)), 'tick', 0.9)]
|
|
86
|
+
elif fx == 'logo-link':
|
|
87
|
+
ev = [(0.0, 'pop', 0.8), (min(0.35, d * 0.3), 'pop', 0.8)]
|
|
88
|
+
return [(start + t, s, g) for t, s, g in ev if 0 <= t <= d]
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def track(evs, duration, gain_db=0.0):
|
|
92
|
+
"""Mix events into a stereo int16 track of `duration` seconds."""
|
|
93
|
+
out = np.zeros(int(duration * SR) + SR, np.float64); g0 = 10 ** (gain_db / 20); cache = {}
|
|
94
|
+
for t, name, g in evs:
|
|
95
|
+
if name not in cache: cache[name] = SOUNDS[name]()
|
|
96
|
+
s = cache[name]; i = int(t * SR)
|
|
97
|
+
if i < 0 or i >= len(out): continue
|
|
98
|
+
j = min(len(out), i + len(s)); out[i:j] += s[:j - i] * g * g0
|
|
99
|
+
out = np.clip(out[:int(duration * SR)], -0.98, 0.98)
|
|
100
|
+
return (np.repeat(out[:, None], 2, axis=1) * 32767).astype(np.int16)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def write(path, pcm):
|
|
104
|
+
with wave.open(path, 'wb') as w:
|
|
105
|
+
w.setnchannels(2); w.setsampwidth(2); w.setframerate(SR); w.writeframes(pcm.tobytes())
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Cut the pauses out of a talking-head video (jump cuts), keeping a natural breath between lines.
|
|
3
|
+
|
|
4
|
+
usage: python trim.py input.mp4 output.mp4 [--gap 0.4] [--keep 0.16] [--speed 1.0] [--dry]
|
|
5
|
+
|
|
6
|
+
--gap only pauses longer than this are cut (seconds)
|
|
7
|
+
--keep how much of each cut pause is kept, so it doesn't sound breathless (seconds)
|
|
8
|
+
--speed 1.0 keeps your normal pace; 1.1 speeds the result up a little
|
|
9
|
+
--dry just print what would be cut
|
|
10
|
+
|
|
11
|
+
Saves output.cuts.json with the parts that were kept, and prints how much time was saved.
|
|
12
|
+
"""
|
|
13
|
+
import argparse, json, os, subprocess, sys
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
import numpy as np
|
|
17
|
+
|
|
18
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[5] / 'pipeline' / 'scripts'))
|
|
19
|
+
from _codec import h264_encode_args
|
|
20
|
+
|
|
21
|
+
SR = 16000
|
|
22
|
+
WIN = 0.02 # analysis window (seconds)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def load_audio(src):
|
|
26
|
+
raw = subprocess.run(['ffmpeg', '-v', 'error', '-i', src, '-vn', '-ac', '1', '-ar', str(SR), '-f', 'f32le', '-'],
|
|
27
|
+
capture_output=True, check=True).stdout
|
|
28
|
+
return np.frombuffer(raw, np.float32)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def runs(b):
|
|
32
|
+
d = np.diff(np.concatenate([[0], b.astype(np.int8), [0]]))
|
|
33
|
+
return list(zip(np.where(d == 1)[0], np.where(d == -1)[0]))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def speech(a, below=30.0):
|
|
37
|
+
"""True for each 20 ms window that sounds like speech (within `below` dB of the loud parts)."""
|
|
38
|
+
w = int(SR * WIN); n = len(a) // w
|
|
39
|
+
lvl = 20 * np.log10(np.sqrt((a[:n * w].reshape(n, w).astype(np.float64) ** 2).mean(1) + 1e-12))
|
|
40
|
+
loud = lvl > max(np.percentile(lvl, 95) - below, -55.0)
|
|
41
|
+
for s, e in runs(~loud): # fill tiny dips inside words
|
|
42
|
+
if (e - s) * WIN < 0.08: loud[s:e] = True
|
|
43
|
+
for s, e in runs(loud): # drop isolated clicks
|
|
44
|
+
if (e - s) * WIN < 0.06: loud[s:e] = False
|
|
45
|
+
return loud
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def keep_parts(loud, dur, gap=0.4, keep=0.16):
|
|
49
|
+
cuts = []
|
|
50
|
+
for s, e in runs(~loud):
|
|
51
|
+
ts, te = s * WIN, min(dur, e * WIN)
|
|
52
|
+
if s == 0: cuts.append((0.0, max(0.0, te - keep * 0.6)))
|
|
53
|
+
elif e >= len(loud) - 1: cuts.append((min(dur, ts + keep * 0.6), dur))
|
|
54
|
+
elif te - ts >= gap: cuts.append((ts + keep * 0.45, te - keep * 0.55))
|
|
55
|
+
parts, t = [], 0.0
|
|
56
|
+
for a, b in cuts:
|
|
57
|
+
if a > t + 0.05: parts.append((t, a))
|
|
58
|
+
t = max(t, b)
|
|
59
|
+
if dur > t + 0.05: parts.append((t, dur))
|
|
60
|
+
return parts or [(0.0, dur)]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def probe(src):
|
|
64
|
+
j = json.loads(subprocess.run(['ffprobe', '-v', 'error', '-show_entries', 'stream=codec_type,r_frame_rate:format=duration',
|
|
65
|
+
'-of', 'json', src], capture_output=True, text=True, check=True).stdout)
|
|
66
|
+
v = [s for s in j['streams'] if s.get('codec_type') == 'video'][0]; num, den = v['r_frame_rate'].split('/')
|
|
67
|
+
return min(float(num) / float(den or 1), 30.0), float(j['format']['duration']), any(s.get('codec_type') == 'audio' for s in j['streams'])
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def main():
|
|
71
|
+
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
72
|
+
ap.add_argument('src'); ap.add_argument('dst', nargs='?')
|
|
73
|
+
ap.add_argument('--gap', type=float, default=0.4); ap.add_argument('--keep', type=float, default=0.16)
|
|
74
|
+
ap.add_argument('--speed', type=float, default=1.0); ap.add_argument('--dry', action='store_true')
|
|
75
|
+
a = ap.parse_args()
|
|
76
|
+
fps, dur, has_audio = probe(a.src)
|
|
77
|
+
if not has_audio: sys.exit('This video has no sound, so there are no pauses to find.')
|
|
78
|
+
fps_txt = f'{fps:.3f}'.rstrip('0').rstrip('.')
|
|
79
|
+
snap = lambda t: round(t * fps) / fps # cut on whole frames so sound and picture stay in sync
|
|
80
|
+
parts = [(snap(s), snap(e)) for s, e in keep_parts(speech(load_audio(a.src)), dur, a.gap, a.keep)]
|
|
81
|
+
parts = [(s, e) for s, e in parts if e - s >= 1 / fps]
|
|
82
|
+
new = sum(e - s for s, e in parts) / a.speed
|
|
83
|
+
print(f'Keeping {len(parts)} parts: {dur:.1f}s -> {new:.1f}s ({dur - new:.1f}s of pauses removed)')
|
|
84
|
+
if a.dry or not a.dst:
|
|
85
|
+
for s, e in parts: print(f' keep {s:7.2f} - {e:7.2f}')
|
|
86
|
+
return
|
|
87
|
+
sel = '+'.join(f'gte(t,{s:.4f})*lt(t,{e:.4f})' for s, e in parts)
|
|
88
|
+
vf = f"[0:v]fps={fps_txt},select='{sel}',setpts=N/FRAME_RATE/TB"
|
|
89
|
+
af = f"[0:a]aselect='{sel}',asetpts=N/SR/TB"
|
|
90
|
+
if abs(a.speed - 1) > 1e-3: vf += f',setpts=PTS/{a.speed}'; af += f',atempo={a.speed}'
|
|
91
|
+
subprocess.run(['ffmpeg', '-v', 'error', '-y', '-i', a.src, '-filter_complex', f'{vf}[v];{af}[a]', '-map', '[v]', '-map', '[a]',
|
|
92
|
+
*h264_encode_args(crf=17, preset='medium'), '-c:a', 'aac', '-b:a', '192k',
|
|
93
|
+
'-movflags', '+faststart', a.dst], check=True)
|
|
94
|
+
json.dump({'source': os.path.basename(a.src), 'speed': a.speed, 'kept': parts}, open(os.path.splitext(a.dst)[0] + '.cuts.json', 'w'), indent=1)
|
|
95
|
+
print('Done:', a.dst)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if __name__ == '__main__':
|
|
99
|
+
main()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Find when each word is said, so effects and captions land on the right word.
|
|
3
|
+
|
|
4
|
+
usage: python words.py input.mp4 -> prints "12.34 word" lines and saves input.words.json
|
|
5
|
+
|
|
6
|
+
Uses Faster-Whisper from the CleoEdits transcription profile. On a Mac with mlx-whisper
|
|
7
|
+
installed, that is used instead. WHISPER_MODEL=base gives a faster, less accurate pass (default: small).
|
|
8
|
+
You can fix spellings in the saved .words.json by hand (e.g. "clot code" -> "Claude Code");
|
|
9
|
+
the effects script uses your edited file as long as it is newer than the video.
|
|
10
|
+
"""
|
|
11
|
+
import json, os, subprocess, sys
|
|
12
|
+
|
|
13
|
+
import numpy as np
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def load_audio(src, sr=16000):
|
|
17
|
+
"""Decode the soundtrack to 16 kHz mono floats with ffmpeg (avoids PyAV quirks)."""
|
|
18
|
+
raw = subprocess.run(['ffmpeg', '-v', 'error', '-i', src, '-vn', '-ac', '1', '-ar', str(sr), '-f', 'f32le', '-'],
|
|
19
|
+
capture_output=True, check=True).stdout
|
|
20
|
+
return np.frombuffer(raw, np.float32).copy()
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def transcribe(src, model_name=None):
|
|
24
|
+
model_name = model_name or os.environ.get('WHISPER_MODEL', 'small')
|
|
25
|
+
try:
|
|
26
|
+
import mlx_whisper
|
|
27
|
+
r = mlx_whisper.transcribe(src, path_or_hf_repo='mlx-community/whisper-large-v3-turbo', word_timestamps=True)
|
|
28
|
+
return [{'w': w['word'].strip(), 's': round(w['start'], 2), 'e': round(w['end'], 2)}
|
|
29
|
+
for seg in r['segments'] for w in seg.get('words', [])]
|
|
30
|
+
except ImportError:
|
|
31
|
+
pass
|
|
32
|
+
try:
|
|
33
|
+
from faster_whisper import WhisperModel
|
|
34
|
+
except ImportError as exc:
|
|
35
|
+
raise RuntimeError("Install the transcription profile with cleoedits install transcription.") from exc
|
|
36
|
+
print(f'Listening for words (whisper {model_name})...', flush=True)
|
|
37
|
+
model = WhisperModel(model_name, device='cpu', compute_type='int8')
|
|
38
|
+
segs, _ = model.transcribe(load_audio(src), word_timestamps=True, vad_filter=True)
|
|
39
|
+
return [{'w': w.word.strip(), 's': round(w.start, 2), 'e': round(w.end, 2)} for s in segs for w in (s.words or [])]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def words_path(src): return os.path.splitext(src)[0] + '.words.json'
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def load_or_make(src):
|
|
46
|
+
"""Reuse <video>.words.json if it is newer than the video (so hand fixes stick), otherwise transcribe."""
|
|
47
|
+
p = words_path(src)
|
|
48
|
+
if os.path.exists(p) and os.path.getmtime(p) >= os.path.getmtime(src):
|
|
49
|
+
return json.load(open(p))
|
|
50
|
+
w = transcribe(src)
|
|
51
|
+
json.dump(w, open(p, 'w'), indent=0)
|
|
52
|
+
return w
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == '__main__':
|
|
56
|
+
src = sys.argv[1]; out = words_path(src)
|
|
57
|
+
words = transcribe(src)
|
|
58
|
+
json.dump(words, open(out, 'w'), indent=0)
|
|
59
|
+
for w in words: print(f"{w['s']:7.2f} {w['w']}")
|
|
60
|
+
print(f'\nSaved {len(words)} words to {out}')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a transparent 3D title or card with Blender.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Check the `blender` profile and use `cleoedits run blender-render -- --help` for render options. Render the requested text or card as a transparent MOV in the job folder. Composite it over the supplied clip or add it to the editable timeline, then verify that the overlay timing and alpha survive export.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Edit a short business reel with a hook, proof, and captions.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Build the cut around the supplied hook and proof points. Use `word-captions` for precise caption timing. Apply `headline-box` or `phone-fan` through `reel_effects/fx.py` when those layouts fit, or build the callouts in Remotion. Keep the captions clear of layouts and check readability at phone size.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Grade footage with FFmpeg curves or a LUT.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Check the `ffmpeg` profile. Compare representative source frames, establish a neutral baseline, and match the requested grade using FFmpeg or the bundled `ffmpeg/color.py` helper. Preview the LUT or tone curve on the shot first, then bake the chosen grade and inspect a contact sheet for clipping and inconsistent skin tones.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Arrange source clips and cutouts into a comparison grid.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Select the supplied comparison clips and propose a layout that leaves room for captions. Use bundled effects such as `place-in-grid` or `broll-split`, or build an overlay in HyperFrames. Use the `cutouts` profile only where a subject needs isolation. Confirm each clip stays legible at the target resolution.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Place animated UI cards around or behind a presenter.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Build the UI cards as an alpha overlay in HyperFrames or use `glass-widgets` through `reel_effects/fx.py`. For genuine occlusion, check the `cutouts` profile and composite with `cleoedits run person-matte -- behind-head` using the foreground clip and overlay. Test a short section for matte flicker and overlapping captions.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Build an animated explainer panel over a presenter clip.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Use HyperFrames or Remotion to make a panel that fits the requested vertical or horizontal frame. Tie counter animation and transitions to the relevant spoken cues. Keep chart labels and captions readable, render the panel as an alpha overlay if needed, and inspect the composite at target resolution.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a freeze-frame accent with an outlined subject sticker.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Choose the hold point in the clip. For an outlined sticker, check the `cutouts` profile and run the `sticker` mode of `cleoedits run person-matte` at the chosen timestamp. Add the name tag and use `pause-point` from the bundled effects when useful. Check the cut into and out of the freeze against the audio.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Animate a glass-style metric graph or counter.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Check the `reel-effects` or `remotion` profile. Build the card from the supplied values using `liquid-glass-graph` in `reel_effects/fx.py` or a Remotion composition. Align the reveal to the matching sentence and confirm the counter ends at the exact metric. Review the card on both light and dark frames.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Place proof points and metric cards beside a speaker.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Use supplied screenshots or metrics to make transparent cards in HyperFrames, or choose the `over-the-shoulder-zoom` reel effect. Place the cards clear of face and captions. If they should pass behind the speaker, use the `cutouts` profile and the `behind-head` mode of `person-matte`. Inspect the matte on head and shoulder movement.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Edit a personal-brand reel with subtle motion and callouts.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Cut around the speaker's complete thoughts. Use the `ffmpeg` profile to balance the image and audio, and choose `slow-push` or `card-drop` from `reel_effects/fx.py` only where it supports the beat. Check timing, legibility, and audio on the exported clip.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Build an animated ranking board over footage.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Use the supplied ranking and artwork. Choose the `tier-list` reel effect or create a custom HyperFrames board with the requested tiers. Align each addition to the relevant commentary and confirm that the final tier placement matches the supplied order.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Test a local grade or a provider-assisted relight.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Choose a lighting direction from the supplied footage and references, then test a local grade for exposure and color. When the request requires generative relighting, check the `cloud-media` profile and review the payload with `cleoedits run cloud-media -- run relight --payload <path>`. Use `--yes` once the user authorizes sending media and spending credits. Compare faces and edges across the cut.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Break a reference video into timings, shots, graphics, and audio cues.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Analyze the supplied local reference or material the user is authorized to download. Probe the frame rate and duration, capture a contact sheet, and use transcription to align spoken cues when useful. Deliver a storyboard covering time ranges, visual layers, transitions, sound, and grade, with an original plan that fits the user's footage.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Composite a headline behind a speaker or foreground subject.
|
|
3
|
+
argument-hint: "[footage and edit brief]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the CleoEdits skill for this request. Read the workspace guide for input and output conventions.
|
|
7
|
+
|
|
8
|
+
Render a transparent title at the target frame size. Check the `cutouts` profile and use `cleoedits run person-matte -- behind-head` with the footage and the overlay. Preview a short section first, then review edges and keep the headline readable through movement.
|
|
9
|
+
|
|
10
|
+
## Request
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|