Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,7 @@ import subprocess
|
|
| 3 |
import os
|
| 4 |
import uuid
|
| 5 |
|
| 6 |
-
def generate_video(
|
| 7 |
-
audio_path = audio.name
|
| 8 |
-
image_path = image.name
|
| 9 |
output_filename = f"output_{uuid.uuid4().hex[:8]}.mp4"
|
| 10 |
|
| 11 |
try:
|
|
@@ -24,11 +22,11 @@ def generate_video(audio, image):
|
|
| 24 |
except Exception as e:
|
| 25 |
return f"⚠️ Error: {str(e)}"
|
| 26 |
|
| 27 |
-
# UI with
|
| 28 |
with gr.Blocks(theme="Taithrah/Minimal") as app:
|
| 29 |
gr.Markdown("# 🎶 Audio to Video Tool\nUpload an audio file and an image to generate a simple MP4 video (like TunesToTube)")
|
| 30 |
with gr.Row():
|
| 31 |
-
audio = gr.Audio(label="🎧 Upload your audio file", type="
|
| 32 |
image = gr.Image(label="🖼️ Upload your image", type="filepath")
|
| 33 |
|
| 34 |
submit = gr.Button("🚀 Generate Video")
|
|
|
|
| 3 |
import os
|
| 4 |
import uuid
|
| 5 |
|
| 6 |
+
def generate_video(audio_path, image_path):
|
|
|
|
|
|
|
| 7 |
output_filename = f"output_{uuid.uuid4().hex[:8]}.mp4"
|
| 8 |
|
| 9 |
try:
|
|
|
|
| 22 |
except Exception as e:
|
| 23 |
return f"⚠️ Error: {str(e)}"
|
| 24 |
|
| 25 |
+
# UI with fixed types
|
| 26 |
with gr.Blocks(theme="Taithrah/Minimal") as app:
|
| 27 |
gr.Markdown("# 🎶 Audio to Video Tool\nUpload an audio file and an image to generate a simple MP4 video (like TunesToTube)")
|
| 28 |
with gr.Row():
|
| 29 |
+
audio = gr.Audio(label="🎧 Upload your audio file", type="filepath")
|
| 30 |
image = gr.Image(label="🖼️ Upload your image", type="filepath")
|
| 31 |
|
| 32 |
submit = gr.Button("🚀 Generate Video")
|