本文整理汇总了Python中moviepy.editor.VideoFileClip.fx方法的典型用法代码示例。如果您正苦于以下问题:Python VideoFileClip.fx方法的具体用法?Python VideoFileClip.fx怎么用?Python VideoFileClip.fx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moviepy.editor.VideoFileClip
的用法示例。
在下文中一共展示了VideoFileClip.fx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import fx [as 别名]
print "Checking movie file"
for arg in sys.argv:
print ("Argument: %s" % str(arg))
videofile = sys.argv[2]
print ("Videofile %s" % str(videofile))
### START MIRROR EFFECT
if sys.argv[1] == '-m':
from moviepy.editor import VideoFileClip, clips_array, vfx
clip1 = VideoFileClip(sdir + videofile).margin(10) # add 10px contour
clip2 = clip1.fx( vfx.mirror_x)
clip3 = clip1.fx( vfx.mirror_y)
clip4 = clip1.fx( vfx.mirror_y)
clip4 = clip4.fx( vfx.mirror_x)
#clip4 = clip1.resize(0.60) # downsize 60%
final_clip = clips_array([[clip1, clip2],
[clip3, clip4]])
final_clip.resize(width=1280).write_videofile(ddir + "mirror.mp4")
### END MIRROR EFFECT
### START EDIT MOVIE EDITS ALL IN ONE DIR CURRENTLY
if sys.argv[1] == '-e':
示例2: load_video
# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import fx [as 别名]
def load_video(filename):
# load clip from file name and resize it to 224px wide
clip = VideoFileClip(filename).fx(resize, width=224)
# desaturate the clip, center it vertically, then return it
m = (224 - clip.h) / 2.0
return clip.fx(blackwhite).fx(margin, top=ceil(m), bottom=floor(m))