@danhachuel/thunderbolt 0.7.69 → 0.7.70

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/app/main.py CHANGED
@@ -8879,7 +8879,7 @@ def render_settings():
8879
8879
  key=f"settings_{key}",
8880
8880
  )
8881
8881
 
8882
- api_keys_tab, upload_api_keys_tab, subtitles_tab, ai_influencers_tab, voice_test_tab = render_localized_tabs(["API Keys", "API Keys Upload", "Legendas", "AI Influencers", "Teste de Voz"])
8882
+ api_keys_tab, upload_api_keys_tab, subtitles_tab, ffmpeg_tab, ai_influencers_tab, voice_test_tab = render_localized_tabs(["API Keys", "API Keys Upload", "Legendas", "FFmpeg", "AI Influencers", "Teste de Voz"])
8883
8883
 
8884
8884
  with api_keys_tab:
8885
8885
  with st.container(border=True):
@@ -9321,6 +9321,49 @@ def render_settings():
9321
9321
  else:
9322
9322
  st.success("Configuração de legendas guardada localmente.")
9323
9323
 
9324
+ with ffmpeg_tab:
9325
+ st.subheader("FFmpeg")
9326
+ st.caption("Seleccione a versão do FFmpeg usada pelo pipeline. O perfil FFmpeg 7.1 Péter é o recomendado para aceleração NVENC em GPUs modernas.")
9327
+ ffmpeg_options = [
9328
+ ("7.1-20240930", "FFmpeg 7.1 Péter — compatível com API NVENC 13.0 / driver 572.00+", "ffmpeg"),
9329
+ ("system", "FFmpeg actual do sistema — pode usar builds 7.1.5+ e exigir API NVENC 13.1", str(settings.get("ffmpeg_system_path") or "ffmpeg").strip() or "ffmpeg"),
9330
+ ]
9331
+ saved_ffmpeg_version = str(settings.get("ffmpeg_version") or "7.1-20240930").strip()
9332
+ ffmpeg_values = [item[0] for item in ffmpeg_options]
9333
+ if saved_ffmpeg_version not in ffmpeg_values:
9334
+ saved_ffmpeg_version = "7.1-20240930"
9335
+ ffmpeg_version = st.radio(
9336
+ "Versão a utilizar",
9337
+ ffmpeg_values,
9338
+ index=ffmpeg_values.index(saved_ffmpeg_version),
9339
+ format_func=lambda value: next(item[1] for item in ffmpeg_options if item[0] == value),
9340
+ key="ffmpeg_version_ui",
9341
+ )
9342
+ selected_ffmpeg_path = next(item[2] for item in ffmpeg_options if item[0] == ffmpeg_version)
9343
+ ffmpeg_path_status = shutil.which(selected_ffmpeg_path) or (selected_ffmpeg_path if Path(selected_ffmpeg_path).is_file() else "")
9344
+ if ffmpeg_path_status:
9345
+ st.success(f"FFmpeg seleccionado disponível: `{ffmpeg_path_status}`")
9346
+ else:
9347
+ st.warning("O executável seleccionado ainda não foi encontrado no PATH. A instalação Windows abaixo pode corrigir isso.")
9348
+ with st.expander("Instalação nativa recomendada — Windows", expanded=False):
9349
+ st.code("winget install --id BtbN.FFmpeg.GPL.7.1 --version 7.1-20240930 -e", language="powershell")
9350
+ st.caption("O instalador do Thunderbolt executa este comando automaticamente em instalações Windows quando o winget está disponível. Depois de instalar, reabra o terminal para actualizar o PATH.")
9351
+ if st.button("Guardar configuração de FFmpeg", type="primary", width="stretch", key="save_ffmpeg_settings"):
9352
+ settings.update({
9353
+ "ffmpeg_version": ffmpeg_version,
9354
+ "ffmpeg_path": selected_ffmpeg_path,
9355
+ })
9356
+ write_json("settings.json", settings)
9357
+ ffmpeg_moneyprinter_path = str(settings.get("moneyprinter_path") or "").strip()
9358
+ if ffmpeg_moneyprinter_path:
9359
+ try:
9360
+ synced = sync_moneyprinter_config(settings, ffmpeg_moneyprinter_path)
9361
+ st.success(f"Configuração de FFmpeg guardada{f' e sincronizada com {synced}' if synced else ''}.")
9362
+ except Exception as exc:
9363
+ st.warning(f"Configuração guardada localmente, mas não foi possível sincronizar config.toml: {exc}")
9364
+ else:
9365
+ st.success("Configuração de FFmpeg guardada localmente.")
9366
+
9324
9367
  with ai_influencers_tab:
9325
9368
  st.subheader("AI Influencers")
9326
9369
  st.caption("Estado do backend usado por Personagens e Geração de Conteúdo IA. O selector e as credenciais são editados nesta aba, em Banco de Dados Influencers.")
@@ -268,7 +268,8 @@ DEFAULTS: dict[str, Any] = {
268
268
  "twelvelabs_api_keys": "",
269
269
  "sonilo_api_key": "",
270
270
  "subtitle_provider": "edge",
271
- "ffmpeg_path": "",
271
+ "ffmpeg_path": "ffmpeg",
272
+ "ffmpeg_version": "7.1-20240930",
272
273
  "video_codec": "h264_nvenc",
273
274
  "material_directory": "",
274
275
  "whisper_model_size": "large-v3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.7.69",
3
+ "version": "0.7.70",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",
@@ -394,6 +394,19 @@ function ensurePython() {
394
394
  return found;
395
395
  }
396
396
 
397
+ function installFfmpegWindows() {
398
+ if (platform() !== "win32" || process.env.THUNDERBOLT_SKIP_FFMPEG_INSTALL === "1") return;
399
+ if (!commandExists("winget")) {
400
+ console.warn("winget não encontrado; o FFmpeg 7.1 não foi instalado automaticamente. Instale-o com: winget install --id BtbN.FFmpeg.GPL.7.1 --version 7.1-20240930 -e");
401
+ return;
402
+ }
403
+ console.log("A instalar FFmpeg 7.1 Péter através do winget...");
404
+ const result = spawnSync("winget", ["install", "--id", "BtbN.FFmpeg.GPL.7.1", "--version", "7.1-20240930", "-e", "--accept-source-agreements", "--accept-package-agreements", "--silent"], { stdio: "inherit", env: pythonEnvironment });
405
+ if (result.status !== 0) {
406
+ console.warn("Não foi possível instalar o FFmpeg 7.1 automaticamente. Execute o comando winget mostrado na aba Configuração API > FFmpeg.");
407
+ }
408
+ }
409
+
397
410
  function cloneMoneyPrinter(path) {
398
411
  if (existsSync(join(path, ".git")) || existsSync(join(path, "pyproject.toml"))) {
399
412
  console.log(`MoneyPrinterTurbo já existe em ${path}; será reutilizado.`);
@@ -472,6 +485,8 @@ function writeSettings(moneyprinterPath) {
472
485
  try { settings = JSON.parse(readFileSync(settingsPath, "utf8")); } catch { settings = {}; }
473
486
  }
474
487
  settings.moneyprinter_path = moneyprinterPath;
488
+ if (!settings.ffmpeg_path) settings.ffmpeg_path = "ffmpeg";
489
+ if (!settings.ffmpeg_version) settings.ffmpeg_version = "7.1-20240930";
475
490
  if (!settings.llm_provider || String(settings.llm_provider).trim().toLowerCase() === "moonshot") {
476
491
  settings.llm_provider = "openai";
477
492
  }
@@ -501,6 +516,7 @@ function main() {
501
516
  if (!skipMpt) cloneMoneyPrinter(moneyprinterPath);
502
517
  if (!skipDeps) installThunderboltDependencies(python);
503
518
  if (!skipDeps && !skipMpt) installMoneyPrinterDependencies(moneyprinterPath);
519
+ if (!skipDeps) installFfmpegWindows();
504
520
  writeSettings(moneyprinterPath);
505
521
  console.log("\nInstalação do Thunderbolt concluída.");
506
522
  console.log(`Pasta Thunderbolt: ${thunderboltHome}`);