I donāt really know how it does it, but while ffmpeg takes 30+ minutes to stabilize a one-minute 4k video, Shotcut does it in 1 minute
Avidemux also incorporated stabilization, but it is less aggressive, something we can appreciate in order not to lose so much detail.
ffmpeg -i video.mp4 -vf vidstabdetect -f null -
ffmpeg -i video.mp4 -vf vidstabtransform=input="transforms.trf" -b 33333k stabilized.mp4