DGSpitzer commited on
Commit
72ad0e4
1 Parent(s): f71f213

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -104,7 +104,7 @@ def get_music(prompt):
104
  return spec, 'output.wav'
105
 
106
 
107
- def merge_video(music, img_list):
108
  #Convert to mp3
109
  mp3file_name = "audio.mp3"
110
  wavfile = AudioSegment.from_wav(music)
@@ -121,12 +121,17 @@ def merge_video(music, img_list):
121
  fourcc = cv2.VideoWriter.fourcc(*'MJPG')
122
  out = cv2.VideoWriter(file_name, fourcc, fps, (1024, 1024))
123
 
124
- for image in img_list:
125
- cv_img = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
126
- for _ in range(slide_time * fps):
127
- #cv_img = cv2.resize(np.array(cv_img), (1024, 1024))
128
- out.write(cv_img)
129
 
 
 
 
 
 
130
  out.release()
131
 
132
 
 
104
  return spec, 'output.wav'
105
 
106
 
107
+ def merge_video(music, image):
108
  #Convert to mp3
109
  mp3file_name = "audio.mp3"
110
  wavfile = AudioSegment.from_wav(music)
 
121
  fourcc = cv2.VideoWriter.fourcc(*'MJPG')
122
  out = cv2.VideoWriter(file_name, fourcc, fps, (1024, 1024))
123
 
124
+ # for image in img_list:
125
+ # cv_img = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
126
+ # for _ in range(slide_time * fps):
127
+ # #cv_img = cv2.resize(np.array(cv_img), (1024, 1024))
128
+ # out.write(cv_img)
129
 
130
+ cv_img = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
131
+ for _ in range(slide_time * fps):
132
+ #cv_img = cv2.resize(np.array(cv_img),
133
+ out.write(cv_img)
134
+
135
  out.release()
136
 
137