Best way, Just ask ur server reseller and they will help you out or even hire devs to do that for u for a cost, u will get perfect script with developer support whenever u need modifications.
IF u find a solution in github but not out of box u can contact that person n they will help u out for a cost too.
if u are looking to learn and do on own. here are some points to search. to make a simple script on ur own. when u search below things itself ull find ideas from other questions from stackoverflow etc.
1. FFMPeg command in shell script.
2. Passing name of file as variable to shell script.
3. Executing shell via php.
4. ffmpeg encoding log as progress bar in php.
5. Watch folder - "use shell script and cron to watch the folder every 5min."
Simple Method = upload.php uploads file dn, name passed as variable and php executes that ffmpeg shell script via shell exec. To monitor conversion, (4)track the log file output of ffmpeg, name log file as name of file name for ease of access.
PS: im not trying to sell a service, i just suggested what i do when i get stuck in something in first line
.