Created
November 21, 2020 13:19
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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