<?php
$videofile = (isset($_GET['file'])) ? strval($_GET['file']) : 'video.flv';
ob_start();
system("ffmpeg -i \"". $videofile . "\" 2>&1");
$size = ob_get_contents();
ob_end_clean();
preg_match('/(\d{2,4})x(\d{2,4})/', $size, $matches);
$width = $matches[1];
$height = $matches[2];
print " Width: " . $width . "<br />\n";
print "Height: " . $height . "<br />\n";
?>