(no title)
iwalton3 | 5 years ago
function stabilize {
tempfile=".temp$RANDOM$RANDOM.trf"
ffmpeg -nostdin -loglevel error -y -i "$1" -vf vidstabdetect=shakiness=5:show=1:result="$tempfile" -f null -
ffmpeg -nostdin -loglevel error -y -i "$1" -vf vidstabtransform=input="$tempfile",unsharp=5:5:0.8:3:3:0.4 -movflags +faststart "$2"
rm "$tempfile"
}
Usage: stabilize infile outfile.mp4
mehrdadn|5 years ago
Update: Just tried it. It seems to do some kind of blurring to smooth the vibrations over several frames instead of trying to cancel the shaking by inverse-transforming the frame with respect to the shake. I think I've tried this in my experiments before -- and I guess it's the difference between "de-shake" and "stabilization"? Sadly it doesn't really seem better to my eyes sadly, but thanks for the help anyway.
pocak|5 years ago
Perhaps you just need to increase the smoothing parameter. I found the default of 10 way too low, and needed around 50-100 for my very shaky 50 fps home videos.
iwalton3|5 years ago
See here: https://ffmpeg.org/ffmpeg-filters.html#vidstabdetect-1
Maybe your ffmpeg build doesn’t have it? Also try removing the log level parameter.