1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-09-21 03:01:42 +00:00
dotfiles/scripts/.bin/deshake-video.sh

15 lines
480 B
Bash
Raw Normal View History

2018-09-12 17:04:59 +00:00
#!/bin/sh
# Encode a video in DVD quality (-crf 23) and use the video stabilization/deshaking plugin
# https://ffmpeg.org/ffmpeg-filters.html#toc-vidstabdetect-1
2018-12-07 17:45:04 +00:00
for VIDEO in "$@";
2018-09-12 17:04:59 +00:00
do
DEST=converted/$VIDEO
if [ -f $DEST ]; then
echo "File $VIDEO already converted"
continue
fi
mkdir -p converted
2018-12-07 17:45:04 +00:00
ffmpeg -i "$VIDEO" -vf vidstabdetect -f null -
ffmpeg -i "$VIDEO" -vf vidstabtransform=smoothing=30:input="transforms.trf" -crf 23 "$DEST"
2018-09-12 17:04:59 +00:00
done