Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. from os import sep
  2. from moviepy.editor import *
  3. import gc
  4.  
  5.     def function():
  6.         clips = []
  7.         for i in range(len(self.cuts)):
  8.             for j in range(len(self.cuts[i])):
  9.                 clips.append((VideoFileClip(video)).subclip((self.cuts[i][j][0]), (self.cuts[i][j][1])))
  10.                 if not self.audio:
  11.                     clips[-1] = clips[-1].without_audio()
  12.  
  13.         location = "output"+sep                
  14.         panel = None
  15.  
  16.         try:
  17.             panel = concatenate_videoclips(clips)
  18.             panel.write_videofile("{}{}{}.{}".format(location, oname, '_'+attempt, output_type), fps=30, bitrate=self.bitrate)
  19.         except Exception as e:
  20.             del panel, clips
  21.             gc.collect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement