简体   繁体   中英

4K Clip Editing with moviepy

I hope to zoom a 4k video. The reason is simply I don't have a high resolution monitor.

from moviepy.editor import VideoFileClip
import moviepy.video.fx.all as vfx
clip = VideoFileClip(file_name)
resized_clip = clip .crop(clip, x1=0, y1=0, x2=1920, y2=1080)

It is the code I used to cut off the upper-right of 4k clip. This type of size modifying was worked for other sizes of video, but not worked for 4k. How can I fix it?

ps Not worked with error.

You may use vfx.crop instead of clip.crop .

The correct syntax is:

clip = VideoFileClip(file_name)
resized_clip = vfx.crop(clip, x1=0, y1=0, x2=1920, y2=1080)
resized_clip.write_videofile("crop.mp4")

The following syntax also works:

clip = VideoFileClip(file_name)
clip.crop(x1=0, y1=0, x2=1920, y2=1080).write_videofile("crop.mp4")

Cropping the top left corner is not the best solution for reducing the resolution.

You are probably looking for resize :

clip = VideoFileClip(file_name)
clip.resize((1920, 1080)).write_videofile("resized.mp4")

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