Hi there,
I am using your example to insert an image into a video file:
import moviepy.editor as mp
video = mp.VideoFileClip("video.mp4")
logo = (mp.ImageClip("logo.png")
.set_duration(video.duration)
.resize(height=50) # if you need to resize...
.margin(right=8, top=8, opacity=0) # (optional) logo-border padding
.set_pos(("right","top")))
final = mp.CompositeVideoClip([video, logo])
final.subclip(1000,1010).write_videofile("test.mp4")
This actually pastes the image on top of all the frame in the video, how can I add the image in the video file at specific time. For example, I would like the Logo image to appear on its own at 5 sec, 15 sec & Logo2 (different logo) at 30 sec.
Is it possible with MoviePy?
Kind Regards
Just found this now, but in case it is useful:
# logo appears at t=5s for a duration of 3s
final = mp.CompositeVideoClip([video, logo.set_start(5).set_duration(3)])
Github is not the best place to ask for support, StackOverflow may work better.
@Zulko is this also the way to create a slide show from a sequence of images?
Stack question: https://softwarerecs.stackexchange.com/questions/52243/video-tutorials-as-code/52248#52248
side note: thank you and your contributors for delivering this awesome OSS product!
@1605200517 Did you manage to solve the problem with the answers provided on SE?
@1605200517 yes, thanks
Most helpful comment
@1605200517 yes, thanks