Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoviePy insert multiple images in a video #840

Closed
RahulPrasad opened this issue Aug 12, 2018 · 4 comments
Closed

MoviePy insert multiple images in a video #840

RahulPrasad opened this issue Aug 12, 2018 · 4 comments
Labels
images Related to ImageClip, or handling of images in general.

Comments

@RahulPrasad
Copy link

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

@Zulko
Copy link
Owner

Zulko commented Sep 6, 2018

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.

@synergiator
Copy link

synergiator commented Sep 19, 2018

@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!

@keikoro keikoro added the images Related to ImageClip, or handling of images in general. label Dec 16, 2018
@keikoro
Copy link
Collaborator

keikoro commented Dec 16, 2018

@1605200517 Did you manage to solve the problem with the answers provided on SE?

@synergiator
Copy link

@1605200517 yes, thanks

@keikoro keikoro closed this as completed Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
images Related to ImageClip, or handling of images in general.
Projects
None yet
Development

No branches or pull requests

4 participants