Prepare CentOS 7 first

Install cPanel, and finish configuration

Create a cPanel account (media.yourdomain.com) with username “media

Move the user (media) to Wheel group in WHM > Home > Security Center > Manage Wheel Group Users

Allow compiler access for the specific user (media) in WHM > Home > Security Center > Compiler Access

If the user is in Jailed Shell, then move the user “media” to Normal Shell in WHM > Home > Account Functions > Manage Shell Access

reboot

Now, run SSH command from a sudo user other than root, so login to SSH as the user media

sudo yum -y groupinstall "Development Tools"

reboot

 

Now follow on https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

When you are in ffmpeg section (https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#FFmpeg) do the command first before configure

sudo mount /tmp -o remount,rw

Then start configure and install ffmpeg

After installation the ffmpeg execute path will be /home/media/bin/ffmpeg