本文整理匯總了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()