|
|
|
|
|
by iwalton3
2260 days ago
|
|
I used this to stabilize a bunch of vacation videos with great results. It works better than the deshake filter but does require two passes. 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 |
|
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.