EuuIia commited on
Commit
c2ee5af
·
verified ·
1 Parent(s): c8c0470

Update api/ltx_server.py

Browse files
Files changed (1) hide show
  1. api/ltx_server.py +12 -15
api/ltx_server.py CHANGED
@@ -414,22 +414,19 @@ class VideoService:
414
  return primeira, segunda
415
 
416
  def _concat_mp4s_no_reencode(self, mp4_a: str, mp4_b: str, out_path: str):
417
- # Concat demuxer do ffmpeg (sem reencode)
418
- import tempfile, subprocess, shlex, os
419
- with tempfile.NamedTemporaryFile("w", delete=False, suffix=".txt") as f:
420
- f.write(f"file '{os.path.abspath(mp4_a)}'\n")
421
- f.write(f"file '{os.path.abspath(mp4_b)}'\n")
422
- list_path = f.name
423
- cmd = f"ffmpeg -y -f concat -safe 0 -i {list_path} -c copy {out_path}"
424
- print(f"[DEBUG] Concat: {cmd}")
425
- try:
426
- subprocess.check_call(shlex.split(cmd))
427
- finally:
428
- try: os.remove(list_path)
429
- except Exception: pass
430
 
431
-
432
-
433
  # --- 6. GERAÇÃO ---
434
  def generate(
435
  self,
 
414
  return primeira, segunda
415
 
416
  def _concat_mp4s_no_reencode(self, mp4_a: str, mp4_b: str, out_path: str):
417
+ # Concat demuxer do ffmpeg (sem reencode)
418
+ with tempfile.NamedTemporaryFile("w", delete=False, suffix=".txt") as f:
419
+ f.write(f"file '{os.path.abspath(mp4_a)}'\n")
420
+ f.write(f"file '{os.path.abspath(mp4_b)}'\n")
421
+ list_path = f.name
422
+ cmd = f"ffmpeg -y -f concat -safe 0 -i {list_path} -c copy {out_path}"
423
+ print(f"[DEBUG] Concat: {cmd}")
424
+ try:
425
+ subprocess.check_call(shlex.split(cmd))
426
+ finally:
427
+ try: os.remove(list_path)
428
+ except Exception: pass
 
429
 
 
 
430
  # --- 6. GERAÇÃO ---
431
  def generate(
432
  self,