Is there a simple solution for this?
In this post (Querying an audio/video file for information) I explained in detail how to use ffmpeg to get the length of a video file. Using the PHP shell_exec()
command you can pass the necessary functions to ffmpeg