Update app.py
Browse files
app.py
CHANGED
|
@@ -88,17 +88,9 @@ def get_frames(video_in, step, name, resize_w):
|
|
| 88 |
def create_video(frames, fps, type):
|
| 89 |
print("building video result")
|
| 90 |
for j, img in enumerate(frames):
|
| 91 |
-
frames[j] = cv2.imread(img).astype(np.uint8)
|
| 92 |
|
| 93 |
mediapy.write_video(type + "_result.mp4", frames, fps=fps)
|
| 94 |
-
|
| 95 |
-
#https://zulko.github.io/moviepy/getting_started/videoclips.html#mask-clips
|
| 96 |
-
#clip = ImageSequenceClip(frames, fps=fps)
|
| 97 |
-
#maskclip = ImageSequenceClip(frames, fps=fps, ismask=True)
|
| 98 |
-
#maskclip.to_mask(canal=1)
|
| 99 |
-
#clip.set_mask(maskclip)
|
| 100 |
-
#clip.write_videofile(type + "_result.mp4", fps=fps, codec='libx265', ffmpeg_params=['-c:v', 'libx265', '-x265-params', 'crf=25', '-pix_fmt', 'yuv420p10le', '-an'], audio=False)
|
| 101 |
-
|
| 102 |
return type + "_result.mp4"
|
| 103 |
|
| 104 |
|
|
|
|
| 88 |
def create_video(frames, fps, type):
|
| 89 |
print("building video result")
|
| 90 |
for j, img in enumerate(frames):
|
| 91 |
+
frames[j] = cv2.cvtColor(cv2.imread(img).astype(np.uint8), cv2.COLOR_BGR2RGB)
|
| 92 |
|
| 93 |
mediapy.write_video(type + "_result.mp4", frames, fps=fps)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
return type + "_result.mp4"
|
| 95 |
|
| 96 |
|