6

TL;DR: my home videos are taking up too much space and are impractical to backup on Dropbox. Which format do you advice to convert them to?

Long version:
One year ago I bought a new compact camera (Canon SX230HS), so I could make nicer pictures and movies of my daughter. While the quality is a big improvement over my previous camera, the filesize of the resulting files also is a lot bigger, especially the movies. In the previous year I produced as much data as in the 8 years before. This is becoming a problem, because I’d like to backup everything on Dropbox, so I'd like to avoid having to backup several gigabytes a month.

I already configured my Canon to shoot in 1280x720 instead of 1920x1080, but this still results in 150 - 200Mb per minute in H.264.
Because those movies are only intended to be viewed by family and friends and posted on youtube/facebook, I'm thinking about converting them to another format. This will obviously lose some quality but I don't think this is a problem, afterall only 10 years ago people where still using tapes for this kind of recording with a lot less quality.

Which format would be best suitable for this? I was thinking WebM, since it seems the results are of rather good quality and because it is pushed by Google I would expect it to have a good change of survival and be recognized.
I'm a big fan of Open formats, so I would prefer the format to be open. But I'd also like it to be as portable as possible. It should be easily playable on most common devices, such as a tablet. (To my surprise this was not really the case on my Google Nexus 7 tablet. When I tried a webm-converted movie on the tablet it had serious problems playing it. I could only get it to play smoothly on the Nexus with the hardware decoder disabled in MX Player.)

Thank you for any advice!

jeroen
  • 455

2 Answers2

7

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 with x264) in terms of quality versus file size. HEVC (encoded with x265) 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 than x265 or libvpx, 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?

slhck
  • 235,242
2

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...