Any ideas how this can be done? I use flv & mp4 video, so both options are welcome.
I had an idea to calculate bitrate per second against file size of a video what is my last option but hope there is better solution.
Thx.
Any ideas how this can be done? I use flv & mp4 video, so both options are welcome.
I had an idea to calculate bitrate per second against file size of a video what is my last option but hope there is better solution.
Thx.
Sounds like http://code.google.com/p/php-mp4info/ might be the answer. It is a simple PHP class to read MP4 meta data from MP4 based files, such as MP4, M4V and F4V.
You will most likely need a 3rd party class such as GetID3 or an extension like ffmpeg.
$meta= new \getID3();
$file = $meta->analyze($filename);
echo("Duration: ".$file['playtime_string'].
" / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
" / Filesize: ".$file['filesize']." bytes<br />");
See How to get video duration, dimension and size in PHP? for more details.