本文整理汇总了Python中moviepy.editor.VideoFileClip.without_audio方法的典型用法代码示例。如果您正苦于以下问题:Python VideoFileClip.without_audio方法的具体用法?Python VideoFileClip.without_audio怎么用?Python VideoFileClip.without_audio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moviepy.editor.VideoFileClip
的用法示例。
在下文中一共展示了VideoFileClip.without_audio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_previous_bests_vid
# 需要导入模块: from moviepy.editor import VideoFileClip [as 别名]
# 或者: from moviepy.editor.VideoFileClip import without_audio [as 别名]
def get_previous_bests_vid(self, option, currloc):
dpoint = None
dpointvidfldr = None
sys.stdout.write("Searching for previous intervals best vine...\n")
for prev_date in self.PREV_DATES:
vidfolderloc = os.path.join(SECTIONS_PATH, option, 'videos', \
str(prev_date))
datafolderloc = os.path.join(SECTIONS_PATH, option, 'data', \
str(prev_date))
for _, _, filenames in os.walk(datafolderloc):
for idx, item in enumerate(filenames):
with open(os.path.join(datafolderloc, item)) as json_file:
json_data = json.load(json_file)
clip = VideoFileClip(os.path.join(vidfolderloc, \
str(json_data["postId"]) + ".mp4"))
if clip.duration > 5:
if not dpoint:
dpoint = json_data
dpointvidfldr = vidfolderloc
elif dpoint["loops"]["count"] < json_data["loops"]\
["count"]:
dpoint = json_data
dpointvidfldr = vidfolderloc
elif not dpoint and idx == len(filenames) - 1:
dpoint = json_data
dpointvidfldr = vidfolderloc
vidfile = os.path.join(dpointvidfldr, str(dpoint["postId"]) + ".mp4")
sys.stdout.write("Adding previous best vid: %s\n" % vidfile)
clip = (VideoFileClip(vidfile).resize((1070, 640)).\
set_start(currloc + 6).crossfadein(1).\
set_position((450, 255)).set_duration(5))
return clip.without_audio()