Spaces:
Sleeping
Sleeping
1littlecoder
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -78,11 +78,11 @@ def generate_video(image_path, audio_path):
|
|
78 |
if audio_path is None or "Error" in audio_path:
|
79 |
return "Error generating video: No valid audio file."
|
80 |
|
81 |
-
image_clip = ImageClip(image_path).set_duration(AudioFileClip(audio_path).duration)
|
82 |
-
audio_clip = AudioFileClip(audio_path)
|
83 |
-
video_clip = image_clip.set_audio(audio_clip)
|
84 |
-
video_output_path =
|
85 |
-
video_clip.write_videofile(video_output_path, codec="libx264", audio_codec="aac")
|
86 |
return video_output_path
|
87 |
except Exception as e:
|
88 |
return f"Error generating video: {e}"
|
|
|
78 |
if audio_path is None or "Error" in audio_path:
|
79 |
return "Error generating video: No valid audio file."
|
80 |
|
81 |
+
#image_clip = ImageClip(image_path).set_duration(AudioFileClip(audio_path).duration)
|
82 |
+
#audio_clip = AudioFileClip(audio_path)
|
83 |
+
#video_clip = image_clip.set_audio(audio_clip)
|
84 |
+
video_output_path = gr.make_waveform((16000, audio_path), bg_image=image_path)
|
85 |
+
#video_clip.write_videofile(video_output_path, codec="libx264", audio_codec="aac")
|
86 |
return video_output_path
|
87 |
except Exception as e:
|
88 |
return f"Error generating video: {e}"
|