Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ from converter import convert_qurancaption_to_qvm
|
|
| 9 |
from subtitle import generate_ass
|
| 10 |
from background import generate_background
|
| 11 |
from renderer import render_final_video
|
| 12 |
-
|
| 13 |
|
| 14 |
# --------------------------------------------------
|
| 15 |
# Startup
|
|
@@ -194,18 +194,30 @@ def process(
|
|
| 194 |
arabic_font
|
| 195 |
)
|
| 196 |
|
| 197 |
-
|
| 198 |
-
"outputs/
|
| 199 |
)
|
| 200 |
|
| 201 |
render_final_video(
|
| 202 |
background_path,
|
| 203 |
audio_path,
|
| 204 |
subtitle_path,
|
| 205 |
-
|
| 206 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
-
return
|
| 209 |
|
| 210 |
|
| 211 |
# --------------------------------------------------
|
|
@@ -228,7 +240,7 @@ Generate cinematic Quran video automatically.
|
|
| 228 |
"""
|
| 229 |
)
|
| 230 |
|
| 231 |
-
intro_video = gr.
|
| 232 |
label="Intro Video (Optional)"
|
| 233 |
)
|
| 234 |
|
|
|
|
| 9 |
from subtitle import generate_ass
|
| 10 |
from background import generate_background
|
| 11 |
from renderer import render_final_video
|
| 12 |
+
from intro import prepend_intro
|
| 13 |
|
| 14 |
# --------------------------------------------------
|
| 15 |
# Startup
|
|
|
|
| 194 |
arabic_font
|
| 195 |
)
|
| 196 |
|
| 197 |
+
main_video = (
|
| 198 |
+
"outputs/main.mp4"
|
| 199 |
)
|
| 200 |
|
| 201 |
render_final_video(
|
| 202 |
background_path,
|
| 203 |
audio_path,
|
| 204 |
subtitle_path,
|
| 205 |
+
main_video
|
| 206 |
)
|
| 207 |
+
|
| 208 |
+
if intro_video:
|
| 209 |
+
|
| 210 |
+
final_video = "outputs/final.mp4"
|
| 211 |
+
|
| 212 |
+
prepend_intro(
|
| 213 |
+
intro_video.name,
|
| 214 |
+
main_video,
|
| 215 |
+
final_video
|
| 216 |
+
)
|
| 217 |
+
|
| 218 |
+
return final_video
|
| 219 |
|
| 220 |
+
return main_video
|
| 221 |
|
| 222 |
|
| 223 |
# --------------------------------------------------
|
|
|
|
| 240 |
"""
|
| 241 |
)
|
| 242 |
|
| 243 |
+
intro_video = gr.File(
|
| 244 |
label="Intro Video (Optional)"
|
| 245 |
)
|
| 246 |
|