Compress mp4 video for the web

Hand Coded Studio
Jul 10, 2017 · 1 min read

Compressing video online is essential to improve the speed of your website. We’ve come across 2 tools that’ll help compress mp4 files.

Firstly, HandBrake — a free Mac app. You simply drag your mp4 file onto the interface and select the output file name. There are lots of settings, but you can usually leave these as they are.

Secondly is a command line tool called ffmpeg. Using the commands below, ffmpeg allows you to easily decrease the file size by 40%.

brew install ffmpeg

ffmpeg -i input.mp4 -c:v libx264 -crf 24 -b:v 1M -c:a aac output.mp4

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade