PHP and FFMPEG – Performing intelligent video conversion

Whenever I have limited experience with something or just need to do some research, I go straight to StackOverflow.com – a computer programming question and answer site.  Out of the 24 questions I’ve asked on the site, only one has gone unanswered to date, and I’ve gleaned countless other answers from questions others have already asked.  In case you haven’t already guessed, I really like the site.

Not long ago, I needed to convert uploaded video files for a project in PHP.  FFMPEG was a clear and obvious choice for the job, but I had never used it before, so I turned to my favorite resource.  Sure enough, I got enough information in the answers to build a fully working solution.  I posted that solution as an answer to my own question in case anyone else could use it.

Unfortunately, StackOverflow seems to be having trouble displaying my answer, so I’ve reposted it here for anyone who needs it.

Read More