Commit
·
1c940e6
1
Parent(s):
72d7de2
Update app.py
Browse files
app.py
CHANGED
|
@@ -263,9 +263,9 @@ def combinar(frase, api_pixabay):
|
|
| 263 |
final_clip.write_videofile(filename)
|
| 264 |
print('listo video')
|
| 265 |
final = filename
|
| 266 |
-
subir(filename,palabras_frases[0])
|
| 267 |
html= '<a href="file/'+final+'" download>Descargar video</a><a href="file/final.mp4" download>Descargar video</a>'
|
| 268 |
-
|
|
|
|
| 269 |
def generate_subtitled_video(video, transcript):
|
| 270 |
input = ffmpeg.input(video)
|
| 271 |
output = ffmpeg.output(input, 'srt'+video, vf="drawtext=text='"+transcript+"':fontcolor=white:fontsize=24:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=((h-text_h-line_h)/9)*10")
|
|
@@ -289,5 +289,5 @@ def subir(video,descripcion):
|
|
| 289 |
|
| 290 |
for video in failed_videos: # each input video object which failed
|
| 291 |
print(f'{video["video"]} with description "{video["description"]}" failed')
|
| 292 |
-
demo = gr.Interface(fn=combinar, inputs=["text","text"], outputs=["video","html"])
|
| 293 |
demo.launch()
|
|
|
|
| 263 |
final_clip.write_videofile(filename)
|
| 264 |
print('listo video')
|
| 265 |
final = filename
|
|
|
|
| 266 |
html= '<a href="file/'+final+'" download>Descargar video</a><a href="file/final.mp4" download>Descargar video</a>'
|
| 267 |
+
image=subir(filename,palabras_frases[0])
|
| 268 |
+
return (final,html,image)
|
| 269 |
def generate_subtitled_video(video, transcript):
|
| 270 |
input = ffmpeg.input(video)
|
| 271 |
output = ffmpeg.output(input, 'srt'+video, vf="drawtext=text='"+transcript+"':fontcolor=white:fontsize=24:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=((h-text_h-line_h)/9)*10")
|
|
|
|
| 289 |
|
| 290 |
for video in failed_videos: # each input video object which failed
|
| 291 |
print(f'{video["video"]} with description "{video["description"]}" failed')
|
| 292 |
+
demo = gr.Interface(fn=combinar, inputs=["text","text"], outputs=["video","html",gr.Image(type="pil", height=360, width=540)])
|
| 293 |
demo.launch()
|