标签:end list search key lambda dir bing editor rom
from moviepy.editor import *
def hebing():
k = os.listdir(‘./video‘)
sortKey = lambda x: int(re.search(r‘(\d+).ts‘, x).group(1))
k.sort(key=sortKey)
L = []
for file in k:
hebing = VideoFileClip(‘./video/%s‘ % file)
L.append(hebing)
final_clip = concatenate_videoclips(L)
final_clip.to_videofile(‘a.mp4‘, fps=24, remove_temp=True)
标签:end list search key lambda dir bing editor rom
原文地址:https://www.cnblogs.com/chenxiyuxiao/p/11675338.html