Converting MP4 To Webm Using FFMPEG and Bash

We just recently added video headers to our blog because videos are awesome. We wrote a bash script to convert MP4 videos to Webm videos to make the experience of adding a new video header easy for our writers. We are also taking the first frame of the video for a poster image. A pre-requisite is that you will need ffmpeg installed. For macOS users, you can use the following Homebrew command.

> brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc

Note the dependencies required to convert a video to Webm. Now for the fun part, the bash script.