Я использовал MoviePy, чтобы создать автоматический редактор для постановки зажима сверху и клип внизу. У меня проблемы с изменением размера своих клипов. Это не позволит мне использовать команду RESRIZE, когда я импортирую ее. Это код, который я использую: < /p>
import os
import random
from moviepy.editor import VideoFileClip, CompositeVideoClip, concatenate_videoclips , clips_array, vfx, AudioFileClip, ImageClip
from moviepy.video.fx import resize
originalFolder = "c:\\Users\\me\\Desktop\\Content Software\\testfold"
list = os.listdir(originalFolder)
minecraftFolder = "c:\\Users\\me\\Desktop\\Content Software\\minecraft"
minecraftList = os.listdir(minecraftFolder)
def videoGen(minecraftList, list):
clipIndex = int(random.random()*len(list))
filePath1 = os.path.join(originalFolder, list[clipIndex])
overlayClip = VideoFileClip(filePath1)
minecraftIndex = int(random.random()*len(minecraftList))
filePath2 = os.path.join(originalFolder, list[minecraftIndex])
minecraftClip = VideoFileClip(filePath2)
clips = ([overlayClip], [minecraftClip])
combined = clips_array(clips)
combinedFinal = resize(combined, width=1080, height=1920)
combinedFinal.write_videofile("test.mp4")
videoGen(minecraftList, list)```
I keep getting this error message every time I run the command:
Traceback (most recent call last):
File "c:\Users\me\Desktop\Content Software\Minecraft Video Gen.py", line 33, in
videoGen(minecraftList, list)
File "c:\Users\me\Desktop\Content Software\Minecraft Video Gen.py", line 28, in videoGen
combinedFinal = resize(combined, width=1080, height=1920)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable
What is it that I'm doing wrong that's causing my code to break? using combined.resize() hasn't worked for me either, I'm really confused because nothing in the docs are solving my problem.
Подробнее здесь: https://stackoverflow.com/questions/771 ... th-moviepy
Изменение размера видеоклипов с помощью фильма ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение