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!

  • 1
    You'll probably get good advice on how to shrink your files, but there's no getting around the fact that video streams contain a lot of data. You can compress this data in various ways, but there's a limit to what you can do without destroying quality. Forget about storing them on Dropbox, unless you're willing to spend a lot of money. You should look at NAS devices or USB3 disks, which cost about $150/terabyte. – Isaac Rabinovitch Feb 24 '13 at 2:04
  • 1
    While people will disagree with this comment, h264 is open enough for your purposes. You could transcode to a lower bitrate using Handbrake. As for backups, you're better off with Backblaze or one of the other dozen online backups, as it'll get everything, not just your videos. – emgee Feb 24 '13 at 2:46
  • I'm currently speaking about 30Gb of pictures and movies for 2012. So if I can reduce the video size to about 10% of their original size, I can already backup for a few years on the cheapest Dropbox account. I like Dropbox because it's easy to use on Android and Linux and I already use it. It makes it also very easy to share pictures. Backing up other stuff is not really an issue as most of my other data is already in Git repositories + I have a backup of everything on a NAS. But I want an off-site backup of my pictures as that is something you can never recreate if disaster strikes... – jeroen Feb 24 '13 at 21:19
up vote 6 down vote accepted

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?

  • Thank you for your excellent answer! After reading the answer by Jochem Kuijpers I started experimenting with ffmpeg and x264. I came to nearly the same conversion-command as in your answer. Except that I'm currently using the MKV container. While both MP4 and MKV play on my Nexus 7 and Samsung TV, I choose MKV so that at least the container is still an Open format. Are there any reasons not to do this? This is the bash command I use: ffmpeg -i $1 -vcodec libx264 -acodec libvo_aacenc -preset slower -crf 23 ${1%.*}.mkv Are there important differences between aac and libvo_aacenc? Thank you! – jeroen Feb 24 '13 at 21:09
  • 1
    No, MKV is absolutely fine if it works for you, but here the situation's similar to the codecs: MP4 is an MPEG standard and (still) has much wider support than MKV. This is likely to change I guess, but it takes time. As for FFmpeg AAC, both aac and libvo_aacenc work fine, however both of them offer bad quality when compared to libfdk_aac or libfaac. You might need to supply higher bitrates to achieve the same quality. For more info see this answer: FFmpeg command to convert MP3 to AAC – slhck Feb 24 '13 at 21:23
  • I had indeed the impression that MP4 is still more widely supported. While I was considering MKV I did a quick test to convert to MP4 with ffmpeg -i foo.mkv -vcodec copy -acodec copy foo.mp4 which seems to work without any problems and only takes a second, because (if I understand it correctly) that simply copies the audio and video into a new container. – jeroen Feb 24 '13 at 22:06
  • I just tried the aac codec and to my surprise the resulting file was actually 100kb smaller, even with -b:a 192k. The output of ffmpeg still showed Stream #0.1: libvo_aacenc, 48kHz, stereo, s16, 200 kb/s. Not sure if that is correct. – jeroen Feb 24 '13 at 22:10
  • 1
    Okay, then you got me confused. Yes, the streams can be copied. As for AAC: If your output shows libvo_aacenc, it'll obviously use that encoder. To use the FFmpeg-native aac encoder, you need -c:a aac -strict experimental. But I don't understand what the question is, maybe we're talking about different things? (You can also post a new question if you like) – slhck Feb 25 '13 at 12:13

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

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.