[英]4K Clip Editing with moviepy
I hope to zoom a 4k video.我希望放大 4k 视频。 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.这是我用来切断4k剪辑右上角的代码。 This type of size modifying was worked for other sizes of video, but not worked for 4k.
这种类型的尺寸修改适用于其他尺寸的视频,但不适用于 4k。 How can I fix it?
我该如何解决?
ps Not worked with error. ps 未解决错误。
You may use vfx.crop
instead of clip.crop
.您可以使用
vfx.crop
代替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")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.