PHP ffmpeg Upload Script
PHP ffmpeg Upload Script, please check reference
i have not fully tested this script,
it's good to learn from, you can see how ffmpeg is being used from php and you can see below mysql is used to insert thumb and encoded video.
this script should work, on most Linux operating systems, with little change to the code to reflect your system.