Update app.py
Browse files
app.py
CHANGED
@@ -87,12 +87,15 @@ def get_frames(video_in, step, name, resize_w):
|
|
87 |
|
88 |
def create_video(frames, fps, type):
|
89 |
print("building video result")
|
|
|
|
|
|
|
90 |
#https://zulko.github.io/moviepy/getting_started/videoclips.html#mask-clips
|
91 |
|
92 |
clip = ImageSequenceClip(frames, fps=fps)
|
93 |
|
94 |
maskclip = ImageSequenceClip(frames, fps=fps, ismask=True)
|
95 |
-
maskclip.to_mask(canal=
|
96 |
clip.set_mask(maskclip)
|
97 |
|
98 |
clip.write_videofile(type + "_result.webm", fps=fps, codec='libvpx9', audio=False)
|
|
|
87 |
|
88 |
def create_video(frames, fps, type):
|
89 |
print("building video result")
|
90 |
+
for j, img in enumerate(frames):
|
91 |
+
frames[j] = cv2.cvtColor(img, cv2.COLOR_RGB2RGBA)
|
92 |
+
|
93 |
#https://zulko.github.io/moviepy/getting_started/videoclips.html#mask-clips
|
94 |
|
95 |
clip = ImageSequenceClip(frames, fps=fps)
|
96 |
|
97 |
maskclip = ImageSequenceClip(frames, fps=fps, ismask=True)
|
98 |
+
maskclip.to_mask(canal=1)
|
99 |
clip.set_mask(maskclip)
|
100 |
|
101 |
clip.write_videofile(type + "_result.webm", fps=fps, codec='libvpx9', audio=False)
|