Skip to content

Instantly share code, notes, and snippets.

@dnouri
Created November 21, 2020 13:19
Show Gist options
  • Save dnouri/c432381742680bf2cbfb697194120215 to your computer and use it in GitHub Desktop.
Save dnouri/c432381742680bf2cbfb697194120215 to your computer and use it in GitHub Desktop.
A moviepy script that flips an input video file and optionally accelerates/decelartes it
import sys
from moviepy.editor import VideoFileClip
import moviepy.video.fx.all as vfx
def main(fname_in, fname_out, duration="1.0"):
duration = float(duration)
clip = VideoFileClip(fname_in)
clip = (clip
.fx(vfx.accel_decel, new_duration=clip.duration * duration)
.fx(vfx.mirror_x)
)
clip.write_videofile(fname_out)
if __name__ == '__main__':
main(*sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment