Created
July 25, 2018 06:56
-
-
Save jakubfiala/e7a140998a17838c4775a9f7b1b6f255 to your computer and use it in GitHub Desktop.
A script to loop an mp4 video similarly to Instagram's boomerang
This file contains 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
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
if [[ "$#" -ne 2 ]]; then | |
echo "Usage: ./boomerang.sh src_file out_file" | |
fi | |
SRC=$1 | |
OUT=$2 | |
REV_SRC="${SRC/.mp4/.rev.mp4}" | |
LIST="part_list.txt" | |
touch $LIST | |
ffmpeg -i $SRC -vf reverse $REV_SRC | |
echo "file '$SRC'" >> $LIST | |
echo "file '$REV_SRC'" >> $LIST | |
ffmpeg -f concat -safe 0 -i $LIST -c copy $OUT | |
rm $REV_SRC $LIST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment