Grayscale profile picture

Patrique Ouimet

Senior Product Engineer

Convert MOV to MP4 with FFMPEG

Wed, Oct 9, 2019 11:34 AM

Intro

A simple bash function to convert an MOV (or .mov) to MP4 (or .mp4). You simply type the function name then a space followed by the file name you wish to convert

NOTE: this requires that ffmpeg is installed

Add the following to your aliases file (i.e. .bashrc, .bash_aliases, .zshrc)

convertMovToMp4() {
    originalFileName="$1"
    newFileName=${originalFileName/\.mov/\.mp4}
    ffmpeg -i "$originalFileName" -q:v 0 "$newFileName"
}

Usage

convertMovToMp4 my-video.mov

You will now have my-video.mp4 in the same directory as my-video.mov