To convert MP4 to WebM video on macOS, install FFmpeg using Homebrew.

  • Step 1: Install Homebrew.
  • Step 2: Install FFmpeg.
  • Step 3: Convert MP4 to WebM.

Step 1: Install Homebrew

Using the terminal app run the following.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2: Install FFmpeg

Using the terminal app run the following.

brew install ffmpeg

Step 3: Convert MP4 to WebM

Next, to convert your MP4 video to WebM lossless, you need to use -crf 0 in the below commands. However, when converting an MP4 file of 8.5MB I got a WebM version that was 91.6MB – 10x larger! Instead, I recommend using -crf 30. This setting created a great-looking video, and my WebM video ended up being 3.4MB – perfect!

Here is how it works:

  1. Log your first pass.
  2. Then run two passes on the video file after the log is created.
ffmpeg  -i your-video-file.mp4  -b:v 0  -crf 30  -pass 1  -an -f webm -y /dev/null
ffmpeg  -i your-video-file.mp4  -b:v 0  -crf 30  -pass 2  output.webm

You can read more about the details of this approach here.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get Involved & Explore More

an abstract painting with blue and yellow colors

Catch up on what I’ve been writing lately.

Show your gratitude.

Join Dare To Code Email List

Get emails from me on full-stack PHP development by subscribing to the Dare To Code mailing list.