Update app.py
Browse files
app.py
CHANGED
|
@@ -490,6 +490,9 @@ def process_magic_recap_video(
|
|
| 490 |
job_id = time.strftime("%Y%m%d_%H%M%S") + "_" + uuid.uuid4().hex[:6]
|
| 491 |
work_dir = os.path.abspath(os.path.join(BASE_WORK_DIR, job_id))
|
| 492 |
os.makedirs(work_dir, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
| 493 |
|
| 494 |
try:
|
| 495 |
progress(0.1, desc="🎙 Transcribing...")
|
|
@@ -612,15 +615,13 @@ def process_magic_recap_video(
|
|
| 612 |
f"pad={target_w}:{target_h}:(ow-iw)/2:(oh-ih)/2:black,ass='{ass_p}'[vfinal]"
|
| 613 |
)
|
| 614 |
|
| 615 |
-
|
| 616 |
inputs = ["-i", video_path]
|
| 617 |
|
| 618 |
if merged_tts:
|
| 619 |
inputs.extend(["-i", merged_tts])
|
| 620 |
-
# [0:a]volume=0.0 ပြုလုပ်ပြီး amix မသုံးတော့ဘဲ AI TTS [1:a] ကို သီးသန့် အသုံးပြုခြင်း
|
| 621 |
complex_af = "[1:a]volume=1.5[afinal]"
|
| 622 |
else:
|
| 623 |
-
# တကယ်လို့ TTS အသံ မထွက်လာခဲ့ရင် မူလအသံကို အသံတိတ် (Mute) စေရန်
|
| 624 |
complex_af = "[0:a]volume=0.0[afinal]"
|
| 625 |
|
| 626 |
cmd = [
|
|
@@ -1130,4 +1131,4 @@ def create_main_app_interface():
|
|
| 1130 |
if __name__ == "__main__":
|
| 1131 |
demo_app = create_main_app_interface()
|
| 1132 |
demo_app.queue(max_size=10)
|
| 1133 |
-
demo_app.launch(css=CUSTOM_CSS, theme=gr.themes.Default())
|
|
|
|
| 490 |
job_id = time.strftime("%Y%m%d_%H%M%S") + "_" + uuid.uuid4().hex[:6]
|
| 491 |
work_dir = os.path.abspath(os.path.join(BASE_WORK_DIR, job_id))
|
| 492 |
os.makedirs(work_dir, exist_ok=True)
|
| 493 |
+
|
| 494 |
+
# OUTPUT VIDEO PATH ကို ကြိုတင် သတ်မှတ်ပေးပါ (Fix for "out_video is not defined")
|
| 495 |
+
out_video = os.path.abspath(f"recap_out_{job_id}.mp4")
|
| 496 |
|
| 497 |
try:
|
| 498 |
progress(0.1, desc="🎙 Transcribing...")
|
|
|
|
| 615 |
f"pad={target_w}:{target_h}:(ow-iw)/2:(oh-ih)/2:black,ass='{ass_p}'[vfinal]"
|
| 616 |
)
|
| 617 |
|
| 618 |
+
# BUILD FFMPEG AUDIO FILTER PIPELINE (MUTED ORIGINAL AUDIO)
|
| 619 |
inputs = ["-i", video_path]
|
| 620 |
|
| 621 |
if merged_tts:
|
| 622 |
inputs.extend(["-i", merged_tts])
|
|
|
|
| 623 |
complex_af = "[1:a]volume=1.5[afinal]"
|
| 624 |
else:
|
|
|
|
| 625 |
complex_af = "[0:a]volume=0.0[afinal]"
|
| 626 |
|
| 627 |
cmd = [
|
|
|
|
| 1131 |
if __name__ == "__main__":
|
| 1132 |
demo_app = create_main_app_interface()
|
| 1133 |
demo_app.queue(max_size=10)
|
| 1134 |
+
demo_app.launch(css=CUSTOM_CSS, theme=gr.themes.Default())
|