Skip to content

Instantly share code, notes, and snippets.

View mjforan's full-sized avatar

Matthew Foran mjforan

  • Detroit, Michigan, USA
View GitHub Profile
@mjforan
mjforan / boomerang.py
Created January 7, 2022 17:24
Create boomerang animation from video or frames
# Goal: video frames are duplicated and reversed (creating effect like Instagram's boomerang) and combined in animated webp
# Requires: ffmpeg, tested on ffmpeg 2021-11-10-git-44c65c6cc0-full_build-www.gyan.dev with Python 3.9.2 on Windows 10
# Args: mode input_file output_file [start_time] [end_time]
# Example: python boomerang.py v test.mp4 out.webp -s 00:00:02 -e 00:00:10
import argparse
import os
import shutil
from signal import signal, SIGINT
import subprocess