Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
#
|
| 374 |
print(f"[{video_id}] Standardizing downloaded video to MP4 format...")
|
| 375 |
cmd_standardize = [
|
| 376 |
"ffmpeg", "-y", "-i", downloaded_video_path,
|
| 377 |
-
"
|
|
|
|
| 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
|
| 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:
|