Stabilize video
# The first pass ('detect') generates stabilization data and saves to `transforms.trf`
# The `-f null -` tells ffmpeg there's no output video file
ffmpeg -i video.MOV -vf vidstabdetect -f null -
# The second pass ('transform') uses the .trf and creates the new stabilized video.
ffmpeg -i video.MOV -vf vidstabtransform video_stabilized.MOV
Both commands in one line
export vid="video.MOV"
ffmpeg -i "$vid" -vf vidstabdetect -f null -; ffmpeg -i "$vid" -vf vidstabtransform "stabilized_$vid";rm transforms.trf
Reduce video size
Using the H.265 codec, we obtain better compression than with H.264.
Using a value of 28 for the CRF (Constant Rate Factor, which goes from 0, maximum quality, to 51, worst quality), we get a significant understanding without losing much quality.
export vid="video.mp4"
ffmpeg -i "$vid" -vcodec libx265 -crf 28 "reduced_$vid"