简体   繁体   中英

Moviepy resize multiple videos

I want to resize multiple videos with moviepy.

This is my code:

clips = glob.glob('./Clips/*.mp4')

clipslist = []

for clip in clips:
    clipslist.append(VideoFileClip(clip))
    
video = concatenate_videoclips(clipslist, method='chain')
video.write_videofile(f'./Done/{title}.mp4', fps=60)

I have tried:

for clip in clips:
    clip.resize(width=1920, height=1080)
    clipslist.append(VideoFileClip(clip))

I got this Error:

AttributeError: 'str' object has no attribute 'resize'

The compose method is fixing this problem but the rendering is very slow. Rendering with compose takes 20 minutes longer.

I want to resize multiple videos with moviepy.

This is my code:

clips = glob.glob('./Clips/*.mp4')

clipslist = []

for clip in clips:
    clipslist.append(VideoFileClip(clip))
    
video = concatenate_videoclips(clipslist, method='chain')
video.write_videofile(f'./Done/{title}.mp4', fps=60)

I have tried:

for clip in clips:
    clip.resize(width=1920, height=1080)
    clipslist.append(VideoFileClip(clip))

I got this Error:

AttributeError: 'str' object has no attribute 'resize'

The compose method is fixing this problem but the rendering is very slow. Rendering with compose takes 20 minutes longer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM