This script uses ffmpeg to convert video files to a WhatsApp compatible format. Will also compress the size down making it more suitable.
Ensure you have ffmpeg installed:
$ brew install ffmpeg
Install the script into a directory on $PATH
$ wget -O ~/.local/bin/whatsapp_video_convert https://gist.githubusercontent.com/nc9/995d37289e55017dd06ee35e95970236/raw/c72eb31f4bddc66c0edcb45ad73c48ee6a713dd0/whatsapp_video_convert.sh
$ chmod +x ~/.local/bin/whatsapp_video_convert
$ whatsapp_video_convert test_video.mp4