Skip to content

Instantly share code, notes, and snippets.

@rraallvv
Last active October 20, 2017 23:12
Show Gist options
  • Select an option

  • Save rraallvv/ad1e2ae260bcb1a4d29132468298da9e to your computer and use it in GitHub Desktop.

Select an option

Save rraallvv/ad1e2ae260bcb1a4d29132468298da9e to your computer and use it in GitHub Desktop.
video_stabilization.sh
#!/bin/bash
mkdir temp
while read -d $'\0' file; do
file=$(echo $file | sed -n 's/\.\/\(.*\)/\1/p')
#echo $file
#continue
ffmpeg -i $file -y -nostdin -vf vidstabdetect=stepsize=6:shakiness=8:accuracy=9:result=transform_vectors.trf -f null -
ffmpeg -i $file -y -nostdin -vf vidstabtransform=input=transform_vectors.trf:zoom=1:smoothing=30,unsharp=5:5:0.8:3:3:0.4 -vcodec libx264 -preset slow -tune film -crf 18 -acodec copy temp/$file
done < <(find . -not -name ".*" -name "*.mp4" -type f -print0)
rm transform_vectors.trf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment