– Tested with Ubuntu 18.04 on March 2020 –
We will use ffmpeg - if you have not already installed it, do it now with
sudo apt install ffmpeg
I have tried a few combinations: from my experience, a good trade-off between quality, compression ratio, and speed is provided by using the h264 video codec and libvorbis for audio.
To compress a video created with your camera, just type:
ffmpeg -i MVI_0123.MOV -c:v h264 -c:a libvorbis MVI_0123.mkv
If you have multiple files inside your directory and you want to convert (and compress) all of them, you can use:
for i in *.MOV; do ffmpeg -i "$i" -c:v h264 -c:a libvorbis "${i%.*}.mkv"; done
and… done!