In which format to store home made videos
What options do I have?
There are currently (as of 2017) three formats with which you could encode your home videos, if you want lossy compression at good file sizes and quality:
- H.264 (MPEG-4 AVC) – the de-facto standard
- H.265 (HEVC) – the H.264 successor
- VP9 – Google's open WebM video codec
Here are some things to consider:
VP9 (encoded with
libvpx
) is better than H.264 (encoded withx264
) in terms of quality versus file size. HEVC (encoded withx265
) is even slightly better than VP9 but with diminishing returns for high resolutions. Netflix has done some extensive testing in this direction.x264
is much faster thanx265
orlibvpx
, so if encoding time is an issue, choose H.264.All of these formats have good support in offline players on PCs.
HEVC is not supported in most browsers, and will likely never be, as it is patent-encumbered and the situation is not developing in a good way.
Mobile devices have best support for H.264. iOS does not support VP9. Android supports all these formats.
How should I do the encoding?
To archive your videos, you should use a constant quality encoding mode (called CRF in the popular x264 encoder). If you just set a constant bit rate, you will get worse quality overall at no real benefit other than knowing which file size you get.
While there are various encoders for H.264—even commercial ones—x264 should give you excellent quality, e.g. with FFmpeg like so:
ffmpeg -i input.mp4 -c:v libx264 -crf 18 -c:a aac -b:a 192k out.mp4
Notes about the settings:
- CRF is set to 18, which will give you more or less visually lossless results. Lower values will give you better quality, and higher values worse quality. Sane values are from 18 to 28. The default is 23. You can use a higher CRF as long as you still like the video quality.
- If the resulting bitrate is too high, some mobile phones / tablets might not be able to play the file. Choose a higher CRF value in this case.
- You can use a different
-preset
setting to increase the compression efficiency at the expense of longer encoding times, e.g. by setting-preset slow
or-preset slower
. - I chose AAC encoding with the FFmpeg built-in encoder at 192 kBit/s. This should be good enough for keeping the audio quality transparent.
And that's all there's to it, really. No other settings needed if you're just in for reducing file size. Read the H.264 encoding guide and the AAC encoding guide for more options though if you're interested.
See also: What parameters should I be looking at to reduce the size of a .MOV file?
H.264's being upgraded to H.265. This would allow even greater compression. However, I think that 150/200MB per minute is way too much. If you were to upload a video to YouTube in 720p, YouTube would compress it to about 10 to 15MB/s. Even though YouTube has some experts who tweak their compression so that it would cost them less bandwidth, you should be able to achieve similar quality with 20MB/s and not 200MB/s.
One simple way to convert video's to such a low bit rate but still high quality, would be to upload them to YouTube (and save as a private video). It would also make it easier to share it with your friends. Drawback is that you might experience long upload times...