VoiceClips commited on
Commit
b8049d0
·
verified ·
1 Parent(s): 4db023e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -370,11 +370,12 @@ def run_production_pipeline(job: TranslationJob, gemini_key: str, elevenlabs_key
370
  for chunk in res.iter_content(chunk_size=8192):
371
  f.write(chunk)
372
 
373
- # 1.5. Standardize video (H.264/AAC, 25 FPS, YUV420p) for OpenCV / Wav2Lip stability
374
  print(f"[{video_id}] Standardizing downloaded video to MP4 format...")
375
  cmd_standardize = [
376
  "ffmpeg", "-y", "-i", downloaded_video_path,
377
- "25", "-c:a", "aac", "-ar", "16000", "-ac", "1",
 
378
  input_video_path
379
  ]
380
  subprocess.run(cmd_standardize, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
@@ -393,8 +394,7 @@ def run_production_pipeline(job: TranslationJob, gemini_key: str, elevenlabs_key
393
  with open(extracted_audio_path, "rb") as audio_file:
394
  audio_data = base64.b64encode(audio_file.read()).decode("utf-8")
395
 
396
- # 🎯 DÜZELTME 2: Endpoint URL'ini tam olarak v1beta'ya yönlendiriyoruz.
397
- # Artık hem faturalı bakiyemiz devrede hem de model jilet gibi adreste bulunacak!
398
  gemini_url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key={gemini_key}"
399
 
400
  if job.has_captions:
 
370
  for chunk in res.iter_content(chunk_size=8192):
371
  f.write(chunk)
372
 
373
+ # 🎯 DÜZELTME 2: FFmpeg standartlaştırma parametreleri eksiksiz ve hatasız hale getirildi (-r 25 eklendi)
374
  print(f"[{video_id}] Standardizing downloaded video to MP4 format...")
375
  cmd_standardize = [
376
  "ffmpeg", "-y", "-i", downloaded_video_path,
377
+ "-c:v", "libx264", "-pix_fmt", "yuv420p", "-r", "25",
378
+ "-c:a", "aac", "-ar", "16000", "-ac", "1",
379
  input_video_path
380
  ]
381
  subprocess.run(cmd_standardize, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 
394
  with open(extracted_audio_path, "rb") as audio_file:
395
  audio_data = base64.b64encode(audio_file.read()).decode("utf-8")
396
 
397
+ # 🎯 DÜZELTME 3: Endpoint URL'i v1beta olarak bırakıldı, faturalı bakiye ile limitsiz akacak!
 
398
  gemini_url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key={gemini_key}"
399
 
400
  if job.has_captions: