Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -193,16 +193,24 @@ def fabriquer_video(joueur: str, texte: str) -> str | None:
|
|
| 193 |
slideshow
|
| 194 |
], check=True, capture_output=True)
|
| 195 |
|
| 196 |
-
# ── 4. Overlay texte + audio ───────────────────────────────────────
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
subprocess.run([
|
| 207 |
"ffmpeg", "-y",
|
| 208 |
"-i", slideshow,
|
|
|
|
| 193 |
slideshow
|
| 194 |
], check=True, capture_output=True)
|
| 195 |
|
| 196 |
+
# ── 4. Overlay texte + audio ───────────────────────────────────────────────
|
| 197 |
+
titre_court = texte_clean[:55] + ("..." if len(texte_clean) > 55 else "")
|
| 198 |
+
vf = (
|
| 199 |
+
# Bandeau bas semi-transparent
|
| 200 |
+
"drawbox=y=ih-220:color=black@0.70:width=iw:height=220:t=fill,"
|
| 201 |
+
# Bandeau haut semi-transparent
|
| 202 |
+
"drawbox=y=0:color=black@0.55:width=iw:height=90:t=fill,"
|
| 203 |
+
# Logo chaîne en haut
|
| 204 |
+
f"drawtext=text='⚽ PRISME FOOT':fontcolor=yellow:fontsize=38"
|
| 205 |
+
f":x=(w-text_w)/2:y=20:shadowcolor=black:shadowx=2:shadowy=2,"
|
| 206 |
+
# Nom du joueur en grand — toujours présent, impossible à manquer
|
| 207 |
+
f"drawtext=text='{joueur_up}':fontcolor=white:fontsize=62:bold=1"
|
| 208 |
+
f":x=(w-text_w)/2:y=ih-200"
|
| 209 |
+
f":box=1:boxcolor=red@0.85:boxborderw=14,"
|
| 210 |
+
# Titre de l'actu en dessous
|
| 211 |
+
f"drawtext=text='{titre_court}':fontcolor=white:fontsize=26"
|
| 212 |
+
f":x=(w-text_w)/2:y=ih-110:shadowcolor=black:shadowx=1:shadowy=1"
|
| 213 |
+
)
|
| 214 |
subprocess.run([
|
| 215 |
"ffmpeg", "-y",
|
| 216 |
"-i", slideshow,
|