Created
January 14, 2018 23:06
-
-
Save timhughes/2f07078613bcf15f82ff9002b4cbde20 to your computer and use it in GitHub Desktop.
Stabilize my GoPro videos
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
#! /bin/sh | |
# | |
# stabilize.sh | |
# | |
fullfile=$(readlink -f $1) | |
dir_name=$(dirname $fullfile) | |
filename=$(basename $fullfile) | |
file_no_ext=${filename%.*} | |
extension="${filename##*.}" | |
tempdir=$(mktemp -d) | |
ffmpeg -i $fullfile -vf vidstabdetect=shakiness=5:show=1 $tempdir/dummy.mp4 | |
ffmpeg -i $fullfile -c:v libx264 -crf 20 -preset slow -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4,scale=1280:720 ${dir_name}/${file_no_ext}-720p.${extension} | |
rm -rf $tempdir | |
# vim: set ft=sh ts=4 sw=4 tw=999 et : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment