Update api/ltx_server_refactored.py
Browse files- api/ltx_server_refactored.py +10 -10
api/ltx_server_refactored.py
CHANGED
|
@@ -291,16 +291,16 @@ class VideoService:
|
|
| 291 |
partes_mp4 = [latents]
|
| 292 |
|
| 293 |
if len(partes_mp4) > 1:
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
|
| 305 |
return final_output_path
|
| 306 |
|
|
|
|
| 291 |
partes_mp4 = [latents]
|
| 292 |
|
| 293 |
if len(partes_mp4) > 1:
|
| 294 |
+
print("[INFO] Múltiplos chunks gerados. Concatenando com transições...")
|
| 295 |
+
final_output_path = os.path.join(results_dir, f"final_{used_seed}.mp4")
|
| 296 |
+
partes_para_concatenar = self._gerar_lista_com_transicoes(temp_dir, partes_mp4, crossfade_frames=8)
|
| 297 |
+
self._concat_mp4s_no_reencode(partes_para_concatenar, final_output_path)
|
| 298 |
+
elif partes_mp4:
|
| 299 |
+
print("[INFO] Apenas um chunk gerado. Movendo para o destino final.")
|
| 300 |
+
final_output_path = os.path.join(results_dir, f"final_{used_seed}.mp4")
|
| 301 |
+
shutil.move(partes_mp4[0], final_output_path)
|
| 302 |
+
else:
|
| 303 |
+
raise RuntimeError("Nenhum vídeo foi gerado.")
|
| 304 |
|
| 305 |
return final_output_path
|
| 306 |
|