Skip to content

Instantly share code, notes, and snippets.

@mburst
Created April 21, 2020 06:13
Show Gist options
  • Save mburst/476d51f6de6e0f41494b65626f908275 to your computer and use it in GitHub Desktop.
Save mburst/476d51f6de6e0f41494b65626f908275 to your computer and use it in GitHub Desktop.
Add Coffin Dancing Meme and Astronomia To Any Short Video
from moviepy.editor import VideoFileClip, AudioFileClip, concatenate_videoclips
dropstart = 19
audio = AudioFileClip('astronomia.mp3')
dance = VideoFileClip('dance.mp4')
clip = VideoFileClip('fail.mp4')
audiostart = max(0, dropstart-clip.duration)
audio = audio.subclip(audiostart, dropstart + dance.duration)
finalclip = concatenate_videoclips([clip, dance], method="compose").set_audio(audio)
finalclip.write_videofile('out.mp4')
@mburst
Copy link
Author

mburst commented Apr 21, 2020

Requires the song in mp3 form, the dancing pallbearers in mp4 and then the video you want to have it appended to. Since the drop starts at 19s, the video needs to be less than 19s. Haven't tested with longer fails though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment