freealise commited on
Commit
d255d69
·
verified ·
1 Parent(s): a93b715

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -90,16 +90,15 @@ def create_video(frames, fps, type):
90
  for j, img in enumerate(frames):
91
  img = cv2.imread(img).astype(np.uint8)
92
  cv2.imwrite(frames[j], cv2.cvtColor(img, cv2.COLOR_RGB2RGBA))
 
 
93
 
94
  #https://zulko.github.io/moviepy/getting_started/videoclips.html#mask-clips
95
-
96
- clip = ImageSequenceClip(frames, fps=fps)
97
-
98
- maskclip = ImageSequenceClip(frames, fps=fps, ismask=True)
99
- maskclip.to_mask(canal=1)
100
- clip.set_mask(maskclip)
101
-
102
- 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)
103
 
104
  return type + "_result.mp4"
105
 
 
90
  for j, img in enumerate(frames):
91
  img = cv2.imread(img).astype(np.uint8)
92
  cv2.imwrite(frames[j], cv2.cvtColor(img, cv2.COLOR_RGB2RGBA))
93
+
94
+ mediapy.write_video(type + "_result.mp4", frames, fps=fps)
95
 
96
  #https://zulko.github.io/moviepy/getting_started/videoclips.html#mask-clips
97
+ #clip = ImageSequenceClip(frames, fps=fps)
98
+ #maskclip = ImageSequenceClip(frames, fps=fps, ismask=True)
99
+ #maskclip.to_mask(canal=1)
100
+ #clip.set_mask(maskclip)
101
+ #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)
 
 
 
102
 
103
  return type + "_result.mp4"
104