1littlecoder commited on
Commit
750ff0f
·
verified ·
1 Parent(s): 44b7d9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 = "output_video.mp4"
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}"