Image for post
Image for post

Reduce file size while maintaining quality

While H.264 encoded videos are everywhere nowadays, advanced video codecs like HEVC and VP9 can reduce file sizes by half while maintaining quality.

Create

Use HandBrake to encode a video source file into 3 different formats:

  1. MP4 container with HEVC video (H.265)
  2. MP4 container with regular H.264
  3. Matroska container (MKV) with VP9 video

MP4/HEVC will be played by iOS and Mac while MP4/H.264 serves as fallback for systems that don’t support more advanced codecs.

VP9 video needs to be in a WebM container to be playable in Firefox and Chrome. Use FFmpeg to convert the MKV/VP9 output from HandBrake to WebM/VP9:

ffmpeg -i input.mkv …

About

Nico Rohrbach

Minimalist.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store