Skip to content

Instantly share code, notes, and snippets.

@TimBroddin
Created January 31, 2018 14:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimBroddin/c6a2c08a1134904bec38b37b18504e63 to your computer and use it in GitHub Desktop.
Save TimBroddin/c6a2c08a1134904bec38b37b18504e63 to your computer and use it in GitHub Desktop.
ffmpeg -i "$1" -r 14 -an -vf scale=1080:1920 -filter:v "setpts=0.5*PTS" "$1.fr.mp4"
#exit;
ffmpeg -i "$1.fr.mp4" -r 30 -filter:v "setpts=0.5*PTS" "$1.rs.mp4"
ffmpeg -i "$1.rs.mp4" -filter_complex "[0:v]reverse,fifo[r];[0:v][r] concat=n=2:v=1 [v] " -map "[v]" "$1.b.mp4"
for i in {1..4}; do printf "file '%s'\n" $1.b.mp4 >> list.$1.txt; done
ffmpeg -f concat -i list.$1.txt -c copy $1.boomerang.mp4
rm "$1.fr.mp4"
rm "$1.rs.mp4"
rm "$1.b.mp4"
rm "list.$1.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment