Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ def video_editor(video, audio, music, width, height, output_title):
|
|
| 11 |
video_clip = video_clip.resize(newsize=(width, height))
|
| 12 |
|
| 13 |
# Add background music if provided
|
| 14 |
-
if music:
|
| 15 |
music_clip = AudioFileClip(music.name)
|
| 16 |
final_audio = CompositeVideoClip([audio_clip, music_clip.set_duration(video_clip.duration)])
|
| 17 |
else:
|
|
@@ -32,7 +32,7 @@ def video_editor(video, audio, music, width, height, output_title):
|
|
| 32 |
inputs = [
|
| 33 |
gr.File(label="Video File"),
|
| 34 |
gr.File(label="Audio File"),
|
| 35 |
-
gr.File(label="Background Music", optional
|
| 36 |
gr.Number(label="Screen Width", default=1280),
|
| 37 |
gr.Number(label="Screen Height", default=720),
|
| 38 |
gr.Textbox(label="Output File Title", default="edited_video")
|
|
|
|
| 11 |
video_clip = video_clip.resize(newsize=(width, height))
|
| 12 |
|
| 13 |
# Add background music if provided
|
| 14 |
+
if music is not None:
|
| 15 |
music_clip = AudioFileClip(music.name)
|
| 16 |
final_audio = CompositeVideoClip([audio_clip, music_clip.set_duration(video_clip.duration)])
|
| 17 |
else:
|
|
|
|
| 32 |
inputs = [
|
| 33 |
gr.File(label="Video File"),
|
| 34 |
gr.File(label="Audio File"),
|
| 35 |
+
gr.File(label="Background Music (Optional)"), # No optional keyword, just handle it in the function
|
| 36 |
gr.Number(label="Screen Width", default=1280),
|
| 37 |
gr.Number(label="Screen Height", default=720),
|
| 38 |
gr.Textbox(label="Output File Title", default="edited_video")
|