This is an old revision of the document!
Compression without important video quality loss (tested with relatively low quality full HD source):
$ ffmpeg -i input -vcodec libx265 -crf 24 output
⇒ -crf is the compression factor. Lower is better, 24 is about as low as is useful for libx265
⇒ Use -vf scale=-1:720 to resize to 720p (keeping aspect ratio with -1, resulting in calculation of width)
⇒ Use -map 0 to keep all streams (audio, subtitles, but also video)