[英]Moviepy Making a CompositeVideoClip of two concatenate_videoclips
Working with the Moviepy lib and I've been beating my head off a wall with this last step for a while. 使用Moviepy lib,最后一段时间我一直不停地跳墙。
GifClips = concatenate_videoclips(TheGIFs, method='compose')
TextClips = concatenate_videoclips(TheTexts, method='compose')
I've written both of these to separate files and they look fine. 我将这两个都写到了单独的文件中,看起来不错。 But I'm having a problem getting them to combine properly.
但是我在使它们正确组合方面遇到问题。
I'm trying: 我正在努力:
FinishedClips = CompositeVideoClip([GifClips, TextClips], size=(1920,1080))
It has the audio from TextClips and shows the GifClips but the text isn't visible. 它具有TextClips的音频并显示GifClips,但文本不可见。 It did show when written alone without the composite.
当单独编写而没有复合语言时,它确实显示出来。
It does work if I combine GifClips with a single TextClip but this doesn't work when I need text clips to run one after another. 如果我将GifClips与单个TextClip结合使用,它确实可以工作,但是当我需要文本剪辑一个接一个地运行时,这将不起作用。
I could run a CompositeVideoClip with every single TextClip and a part of the GifClips and then concatenate them all together but that doesn't seem like the neatest way of doing this. 我可以对每个TextClip和GifClips的一部分运行CompositeVideoClip,然后将它们全部连接在一起,但这似乎并不是最巧妙的方法。 My guess is there's a fairly obvious argument here somewhere but looking through the docs and examples I'm struggling so far.
我的猜测是,这里某处有一个相当明显的论据,但仔细阅读到目前为止我一直在努力的文档和示例。
Any suggestions on how I could get the TextClips clip to show up properly in a composite would be much appreciated. 我对如何使TextClips剪辑正确显示在合成中的任何建议将不胜感激。
Alright looks like I found the answer. 好吧,看起来我找到了答案。 Remove the method argument when concatenating the TextClips and set the position again once the concatenate is done.
串联TextClip时删除方法参数,并在串联完成后再次设置位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.