primocode 10.16.0 → 10.17.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.
- package/LICENSES/edit-ia-pro.txt +32 -0
- package/LICENSES/fontes-OFL.txt +476 -0
- package/LICENSES/hyperframes-Apache-2.0.txt +205 -0
- package/LICENSES/permanent-marker-Apache-2.0.txt +204 -0
- package/LICENSES/selfie-multiclass-Apache-2.0.txt +227 -0
- package/LICENSES/three-MIT.txt +23 -0
- package/LICENSES/video-use-MIT.txt +24 -0
- package/LICENSES/woven-sfx-CC0.txt +16 -0
- package/LICENSES/yunet-MIT.txt +21 -0
- package/README.md +2 -2
- package/bin/primocode.js +28 -8
- package/editor/LICENSE.md +11 -0
- package/editor/README.md +321 -0
- package/editor/SKILL.md +307 -0
- package/editor/THIRD_PARTY_NOTICES.md +228 -0
- package/editor/assets/baixar.json +591 -0
- package/editor/assets/fonts/anton/OFL.txt +93 -0
- package/editor/assets/fonts/caveat/OFL.txt +93 -0
- package/editor/assets/fonts/figtree/OFL.txt +93 -0
- package/editor/assets/fonts/fonts.json +10 -0
- package/editor/assets/fonts/montserrat/OFL.txt +93 -0
- package/editor/assets/fonts/permanentmarker/LICENSE.txt +202 -0
- package/editor/assets/models/SELFIE_MULTICLASS_LICENSE.txt +227 -0
- package/editor/assets/models/YUNET_LICENSE.txt +21 -0
- package/editor/assets/sfx/licencas/bass_drop.txt +32 -0
- package/editor/assets/sfx/licencas/cash.txt +76 -0
- package/editor/assets/sfx/licencas/charge.txt +31 -0
- package/editor/assets/sfx/licencas/click.txt +46 -0
- package/editor/assets/sfx/licencas/coin.txt +50 -0
- package/editor/assets/sfx/licencas/count.txt +47 -0
- package/editor/assets/sfx/licencas/data.txt +31 -0
- package/editor/assets/sfx/licencas/error.txt +32 -0
- package/editor/assets/sfx/licencas/flash.txt +31 -0
- package/editor/assets/sfx/licencas/gears.txt +82 -0
- package/editor/assets/sfx/licencas/keyboard.txt +48 -0
- package/editor/assets/sfx/licencas/metal_hit.txt +62 -0
- package/editor/assets/sfx/licencas/metal_riser.txt +61 -0
- package/editor/assets/sfx/licencas/mouse_click.txt +50 -0
- package/editor/assets/sfx/licencas/notification.txt +54 -0
- package/editor/assets/sfx/licencas/pop.txt +38 -0
- package/editor/assets/sfx/licencas/rewind.txt +32 -0
- package/editor/assets/sfx/licencas/rise.txt +46 -0
- package/editor/assets/sfx/licencas/sinteticos.txt +21 -0
- package/editor/assets/sfx/licencas/snap.txt +50 -0
- package/editor/assets/sfx/licencas/success.txt +40 -0
- package/editor/assets/sfx/licencas/synth_hit.txt +32 -0
- package/editor/assets/sfx/licencas/tick.txt +14 -0
- package/editor/assets/sfx/licencas/whoosh.txt +47 -0
- package/editor/assets/sfx/licencas/wind.txt +31 -0
- package/editor/assets/sfx/sfx.json +832 -0
- package/editor/assets/sfx/sfx_sinteticos.json +317 -0
- package/editor/assets/sfx/sfx_woven.json +387 -0
- package/editor/assets/sfx/woven/LICENCA.md +16 -0
- package/editor/fichas/briefing-do-video.md +45 -0
- package/editor/fichas/conferencia-da-amostra.md +56 -0
- package/editor/fichas/matriz-de-ganchos.csv +3 -0
- package/editor/fichas/padrao.json +16 -0
- package/editor/fichas/planilha-de-cenas.csv +4 -0
- package/editor/fichas/planilha-de-versoes.csv +4 -0
- package/editor/fichas/plano-em-blocos.md +32 -0
- package/editor/fichas/registro-de-materiais.json +27 -0
- package/editor/helpers/assets_ocr/ocr_vision.swift +41 -0
- package/editor/helpers/bordas_precisas.py +272 -0
- package/editor/helpers/camera_viva.py +426 -0
- package/editor/helpers/captions.py +601 -0
- package/editor/helpers/common.py +308 -0
- package/editor/helpers/compose_final.py +3555 -0
- package/editor/helpers/conferir_corte.py +234 -0
- package/editor/helpers/conferir_dados.py +405 -0
- package/editor/helpers/contact_sheet.py +282 -0
- package/editor/helpers/corte_por_onda.py +433 -0
- package/editor/helpers/corte_seco.py +595 -0
- package/editor/helpers/denoise.py +971 -0
- package/editor/helpers/efeitos.py +408 -0
- package/editor/helpers/efeitos_gerar.py +159 -0
- package/editor/helpers/elevenlabs_api.py +442 -0
- package/editor/helpers/face_layout.py +570 -0
- package/editor/helpers/fetch_images.py +423 -0
- package/editor/helpers/ganho_por_trecho.py +214 -0
- package/editor/helpers/gen_image.py +312 -0
- package/editor/helpers/gen_music.py +316 -0
- package/editor/helpers/gen_sfx.py +148 -0
- package/editor/helpers/grade.py +307 -0
- package/editor/helpers/icloud.py +119 -0
- package/editor/helpers/make_sfx.py +940 -0
- package/editor/helpers/matte.py +1342 -0
- package/editor/helpers/medir_referencia.py +2232 -0
- package/editor/helpers/mixar_trilha.py +354 -0
- package/editor/helpers/montar_corte.py +295 -0
- package/editor/helpers/motion/__init__.py +13 -0
- package/editor/helpers/motion/engine.py +1915 -0
- package/editor/helpers/motion/registry.py +510 -0
- package/editor/helpers/motion/render.py +665 -0
- package/editor/helpers/motion/templates/barra_progresso.py +370 -0
- package/editor/helpers/motion/templates/carimbo.py +132 -0
- package/editor/helpers/motion/templates/checklist.py +271 -0
- package/editor/helpers/motion/templates/comentario_cta.py +380 -0
- package/editor/helpers/motion/templates/contador.py +222 -0
- package/editor/helpers/motion/templates/destaque.py +263 -0
- package/editor/helpers/motion/templates/etiqueta_preco.py +461 -0
- package/editor/helpers/motion/templates/grafico_barras.py +510 -0
- package/editor/helpers/motion/templates/grafico_linha.py +462 -0
- package/editor/helpers/motion/templates/notificacao.py +266 -0
- package/editor/helpers/motion/templates/palavra_impacto.py +410 -0
- package/editor/helpers/motion/templates/passos.py +321 -0
- package/editor/helpers/motion/templates/riscado.py +298 -0
- package/editor/helpers/motion/templates/selo_garantia.py +150 -0
- package/editor/helpers/motion_render.py +241 -0
- package/editor/helpers/motion_sugerir.py +961 -0
- package/editor/helpers/noise_check.py +134 -0
- package/editor/helpers/pack_transcripts.py +223 -0
- package/editor/helpers/palavras_na_onda.py +176 -0
- package/editor/helpers/plano_sfx.py +839 -0
- package/editor/helpers/portao.py +427 -0
- package/editor/helpers/preview_server.py +1177 -0
- package/editor/helpers/rastrear_rosto.py +298 -0
- package/editor/helpers/render_cut.py +1256 -0
- package/editor/helpers/respiros.py +89 -0
- package/editor/helpers/sincronizar_cameras.py +571 -0
- package/editor/helpers/speech_regions.py +423 -0
- package/editor/helpers/style_catalog.json +231 -0
- package/editor/helpers/style_samples.py +246 -0
- package/editor/helpers/tela_verde.py +2113 -0
- package/editor/helpers/text_render.py +2059 -0
- package/editor/helpers/texto_na_tela.py +366 -0
- package/editor/helpers/timeline_view.py +292 -0
- package/editor/helpers/tira_de_quadros.py +113 -0
- package/editor/helpers/transcribe.py +734 -0
- package/editor/helpers/transcribe_batch.py +129 -0
- package/editor/helpers/trilhas.py +1146 -0
- package/editor/helpers/trilhas_humores.json +66 -0
- package/editor/helpers/valores.py +187 -0
- package/editor/helpers/verify_cut.py +820 -0
- package/editor/helpers/voice_levels.py +233 -0
- package/editor/helpers/voz_check.py +386 -0
- package/editor/helpers/voz_limpa.py +81 -0
- package/editor/helpers/watch_preview.py +372 -0
- package/editor/modelo-projeto/LEIA.md +402 -0
- package/editor/modelo-projeto/assets/fontes/OFL-Caveat.txt +93 -0
- package/editor/modelo-projeto/assets/fontes/OFL-JetBrainsMono.txt +93 -0
- package/editor/modelo-projeto/assets/fontes/OFL-Montserrat.txt +93 -0
- package/editor/modelo-projeto/assets/fontes/larguras.json +1 -0
- package/editor/modelo-projeto/assets/three/BufferGeometryUtils.js +1438 -0
- package/editor/modelo-projeto/assets/three/GLTFLoader.js +4895 -0
- package/editor/modelo-projeto/assets/three/LICENSE +21 -0
- package/editor/modelo-projeto/assets/three/ORIGEM.txt +17 -0
- package/editor/modelo-projeto/assets/three/RoomEnvironment.js +185 -0
- package/editor/modelo-projeto/assets/three/three.core.min.js +6 -0
- package/editor/modelo-projeto/assets/three/three.module.min.js +6 -0
- package/editor/modelo-projeto/build.py +4828 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_antes_depois.html +199 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_arquivo.html +232 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_busca.html +315 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_comando.html +304 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_conversa.html +217 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_esquema.html +289 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_medidor.html +249 -0
- package/editor/modelo-projeto/compositions/cenas/2d/k2d_notas.html +233 -0
- package/editor/modelo-projeto/compositions/cenas/3d/k3d_caminho.html +197 -0
- package/editor/modelo-projeto/compositions/cenas/3d/k3d_explodida.html +152 -0
- package/editor/modelo-projeto/compositions/cenas/3d/k3d_tela.html +167 -0
- package/editor/modelo-projeto/compositions/cenas/3d/k3d_volume.html +124 -0
- package/editor/modelo-projeto/compositions/cenas/3d/motor-three.js +728 -0
- package/editor/modelo-projeto/compositions/cenas/LEIA.md +177 -0
- package/editor/modelo-projeto/ferramentas/medir_fontes.py +65 -0
- package/editor/modelo-projeto/ferramentas/pessoa_recortada.py +176 -0
- package/editor/modelo-projeto/ferramentas/rastrear_maos.py +189 -0
- package/editor/modelo-projeto/hyperframes.json +12 -0
- package/editor/modelo-projeto/package.json +11 -0
- package/editor/modelo-projeto/projeto.json +16 -0
- package/editor/preview/app.css +1009 -0
- package/editor/preview/app.js +2122 -0
- package/editor/preview/index.html +307 -0
- package/editor/pyproject.toml +23 -0
- package/editor/references/3d.md +236 -0
- package/editor/references/animacao-catalogo.md +672 -0
- package/editor/references/animacao.md +498 -0
- package/editor/references/comandos.md +92 -0
- package/editor/references/corte-seco-como-funciona.md +50 -0
- package/editor/references/corte-seco.md +88 -0
- package/editor/references/corte.md +290 -0
- package/editor/references/direcao-por-blocos.md +218 -0
- package/editor/references/enquadramento.md +654 -0
- package/editor/references/estilos-prontos.md +355 -0
- package/editor/references/estudio.md +100 -0
- package/editor/references/exemplo-eventos.json +67 -0
- package/editor/references/lettering.md +252 -0
- package/editor/references/modelos.md +494 -0
- package/editor/references/phase2.md +1007 -0
- package/editor/references/referencia-aplicar.md +203 -0
- package/editor/references/referencia-medir.md +375 -0
- package/editor/references/revisao.md +335 -0
- package/editor/references/som-e-trilha.md +146 -0
- package/editor/references/tabela-de-sons.md +130 -0
- package/editor/references/variacoes.md +234 -0
- package/editor/uv.lock +1141 -0
- package/lib/act.js +36 -8
- package/lib/catalogo.js +4 -0
- package/lib/chamada-torta.js +81 -0
- package/lib/editor-pro.js +786 -0
- package/lib/entrega.js +58 -0
- package/lib/estudio/conferencia-visual.js +76 -0
- package/lib/estudio/diretor.js +6 -1
- package/lib/estudio/exportar.js +3 -1
- package/lib/estudio/gosto.js +45 -4
- package/lib/estudio/index.js +8 -5
- package/lib/estudio/kit-ae/base.jsx +119 -13
- package/lib/estudio/kit-ae/cenas.jsx +47 -15
- package/lib/estudio/kit-ae/guarda.jsx +274 -0
- package/lib/estudio/kit-ae/primitivas.jsx +180 -24
- package/lib/estudio/maquina-diretor.js +61 -7
- package/lib/estudio/maquina-foto.js +177 -0
- package/lib/estudio/maquina-guarda.js +207 -0
- package/lib/estudio/maquina-layout.js +22 -1
- package/lib/estudio/maquina.js +60 -11
- package/lib/estudio/referencias.js +1 -1
- package/lib/estudio/visao/visao.swift +97 -0
- package/lib/estudio/visao.js +60 -0
- package/lib/local/cerebro.json +192 -6
- package/lib/local/motor.js +5 -2
- package/lib/mcp.js +105 -7
- package/lib/nuvem.js +11 -1
- package/lib/outra-pasta.js +1 -1
- package/lib/passagem.js +50 -0
- package/lib/perigo.js +29 -12
- package/lib/protecao.js +134 -0
- package/lib/sandbox.js +11 -4
- package/lib/titulo-conversa.js +46 -0
- package/lib/tools.js +3 -0
- package/lib/ui.js +1 -1
- package/package.json +3 -2
- package/skills/editar-meu-video/SKILL.md +6 -2
- package/skills/editar-video/SKILL.md +113 -0
- package/studio/pessoa.py +52 -0
- package/voz/primo_voz/app.py +43 -4
- package/voz/primo_voz/chat.html +17 -6
- package/voz/primo_voz/painel_dados.py +134 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Adapted from browser-use/video-use (MIT, (c) 2026 Browser Use). See THIRD_PARTY_NOTICES.md.
|
|
2
|
+
"""Transcribe every video in a folder, one after the other.
|
|
3
|
+
|
|
4
|
+
Not recursive; the edit/ folder is skipped. Each file is cached by its signature
|
|
5
|
+
(see transcribe.py), and a failure on one file does not stop the others.
|
|
6
|
+
|
|
7
|
+
Before opening anything, every video that is only in iCloud (macOS placeholder) is downloaded or the batch stops
|
|
8
|
+
with a message: ffprobe and ffmpeg hang on such a file without any error (helpers/icloud.py). At the end, the
|
|
9
|
+
videos with a warning (too few words for the voice measured) are listed again.
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
uv run python helpers/transcribe_batch.py <videos_dir> [--language pt] [--edit-dir DIR]
|
|
13
|
+
[--model large-v3-turbo] [--force] [--prompt "Kiwify, Hubla"] [--no-prompt]
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import argparse
|
|
19
|
+
import sys
|
|
20
|
+
import time
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from common import load_json
|
|
24
|
+
from icloud import SoNaNuvem, garantir_local
|
|
25
|
+
from speech_regions import AudioError
|
|
26
|
+
from transcribe import (
|
|
27
|
+
DEFAULT_MODEL,
|
|
28
|
+
VIDEO_EXTS,
|
|
29
|
+
EngineError,
|
|
30
|
+
build_prompt,
|
|
31
|
+
default_engine,
|
|
32
|
+
is_cached,
|
|
33
|
+
transcribe_one,
|
|
34
|
+
transcript_path,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def find_videos(videos_dir: Path) -> list[Path]:
|
|
39
|
+
out = []
|
|
40
|
+
for p in sorted(videos_dir.iterdir(), key=lambda x: x.name.lower()):
|
|
41
|
+
if p.name.startswith(".") or p.name == "edit":
|
|
42
|
+
continue
|
|
43
|
+
if p.suffix.lower() in VIDEO_EXTS and p.is_file():
|
|
44
|
+
out.append(p)
|
|
45
|
+
return out
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def duplicate_names(videos: list[Path]) -> list[list[Path]]:
|
|
49
|
+
"""Videos that share a name without extension (case-insensitive): transcripts/<stem>.json,
|
|
50
|
+
regions/<stem>.json and the EDL source key would collide."""
|
|
51
|
+
groups: dict[str, list[Path]] = {}
|
|
52
|
+
for v in videos:
|
|
53
|
+
groups.setdefault(v.stem.lower(), []).append(v)
|
|
54
|
+
return [g for g in groups.values() if len(g) > 1]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def main() -> None:
|
|
58
|
+
ap = argparse.ArgumentParser(description="Transcreve todos os vídeos de uma pasta, um de cada vez, com cache.")
|
|
59
|
+
ap.add_argument("videos_dir", type=Path, help="pasta com os vídeos brutos")
|
|
60
|
+
ap.add_argument("--edit-dir", type=Path, default=None, help="pasta edit (padrão: <pasta>/edit)")
|
|
61
|
+
ap.add_argument("--language", default="pt", help="idioma falado (padrão pt; 'auto' detecta)")
|
|
62
|
+
ap.add_argument("--model", default=DEFAULT_MODEL, help="modelo Whisper (padrão large-v3-turbo)")
|
|
63
|
+
ap.add_argument("--force", action="store_true", help="transcreve de novo mesmo com cache")
|
|
64
|
+
ap.add_argument("--prompt", default=None, help="palavras que aparecem nos vídeos (ex.: \"Kiwify, Hubla\")")
|
|
65
|
+
ap.add_argument("--no-prompt", action="store_true", help="não usa o prompt padrão com vícios de fala")
|
|
66
|
+
args = ap.parse_args()
|
|
67
|
+
|
|
68
|
+
videos_dir = args.videos_dir.absolute()
|
|
69
|
+
if not videos_dir.is_dir():
|
|
70
|
+
sys.exit(f"pasta não encontrada: {videos_dir}")
|
|
71
|
+
edit_dir = (args.edit_dir.absolute() if args.edit_dir else videos_dir / "edit")
|
|
72
|
+
videos = find_videos(videos_dir)
|
|
73
|
+
if not videos:
|
|
74
|
+
sys.exit(f"nenhum vídeo ({', '.join(VIDEO_EXTS)}) em {videos_dir}")
|
|
75
|
+
clashes = duplicate_names(videos)
|
|
76
|
+
if clashes:
|
|
77
|
+
pairs = "; ".join(" e ".join(v.name for v in g) for g in clashes)
|
|
78
|
+
sys.exit(f"vídeos com o mesmo nome (só muda a extensão): {pairs}.\n"
|
|
79
|
+
"A transcrição de um apagaria a do outro. Renomeie um de cada par "
|
|
80
|
+
f"(ex.: {clashes[0][-1].stem}_2{clashes[0][-1].suffix}) e rode de novo. Nada foi transcrito.")
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
garantir_local(videos)
|
|
84
|
+
except SoNaNuvem as exc:
|
|
85
|
+
sys.exit(f"{exc}\nNada foi transcrito.")
|
|
86
|
+
|
|
87
|
+
prompt = build_prompt(args.prompt, not args.no_prompt)
|
|
88
|
+
engine = default_engine()
|
|
89
|
+
language = None if args.language.lower() == "auto" else args.language
|
|
90
|
+
cached = [v for v in videos
|
|
91
|
+
if not args.force and is_cached(transcript_path(edit_dir, v), v.absolute(), engine, args.model, language, prompt)]
|
|
92
|
+
print(f"{len(videos)} vídeos em {videos_dir.name} ({len(cached)} em cache, {len(videos) - len(cached)} para transcrever)",
|
|
93
|
+
flush=True)
|
|
94
|
+
|
|
95
|
+
t0 = time.time()
|
|
96
|
+
failures: list[tuple[Path, str]] = []
|
|
97
|
+
for i, video in enumerate(videos, 1):
|
|
98
|
+
print(f"[{i}/{len(videos)}] {video.name}", flush=True)
|
|
99
|
+
try:
|
|
100
|
+
transcribe_one(video, edit_dir=edit_dir, language=args.language, model=args.model,
|
|
101
|
+
force=args.force, prompt=prompt)
|
|
102
|
+
except (AudioError, EngineError, FileNotFoundError, RuntimeError, OSError) as exc:
|
|
103
|
+
msg = str(exc).strip().splitlines()[0] if str(exc).strip() else exc.__class__.__name__
|
|
104
|
+
failures.append((video, msg))
|
|
105
|
+
print(f" falhou: {msg}", flush=True)
|
|
106
|
+
except Exception as exc: # noqa: BLE001 - one bad file must not stop the batch
|
|
107
|
+
failures.append((video, f"{exc.__class__.__name__}: {exc}"))
|
|
108
|
+
print(f" falhou: {exc.__class__.__name__}: {exc}", flush=True)
|
|
109
|
+
|
|
110
|
+
dt = time.time() - t0
|
|
111
|
+
ok = len(videos) - len(failures)
|
|
112
|
+
print(f"pronto em {dt:.1f}s: {ok} de {len(videos)} transcritos em {edit_dir / 'transcripts'}")
|
|
113
|
+
avisos = [(v, (load_json(transcript_path(edit_dir, v)) or {}).get("aviso")) for v in videos]
|
|
114
|
+
avisos = [(v, a) for v, a in avisos if a]
|
|
115
|
+
if avisos:
|
|
116
|
+
print(f"{len(avisos)} com aviso (confira antes de escolher as frases):")
|
|
117
|
+
for video, msg in avisos:
|
|
118
|
+
print(f" {video.name}: {msg}")
|
|
119
|
+
if failures:
|
|
120
|
+
print(f"{len(failures)} com erro:")
|
|
121
|
+
for video, msg in failures:
|
|
122
|
+
print(f" {video.name}: {msg}")
|
|
123
|
+
sys.exit(1)
|
|
124
|
+
skill_root = Path(__file__).resolve().parent.parent
|
|
125
|
+
print(f"próximo passo: uv run --directory '{skill_root}' python helpers/pack_transcripts.py --edit-dir '{edit_dir}'")
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if __name__ == "__main__":
|
|
129
|
+
main()
|