There's also flv4php.
If the file's header contains the video's dimensions (which might not always be the case), you can also use the following code:
function flvdim($name) {
$file = @fopen($name, 'rb');
if($file === false)
return false;
$header = fread($file, 2048);
fclose($file);
if($header === false)
return false;
return array(
'width' => flvdim_get($header, 'width'),
'height' => flvdim_get($header, 'height')
);
}
function flvdim_get($header, $field) {
$pos = strpos($header, $field);
if($pos === false)
return false;
$pos += strlen($field) + 2;
return flvdim_decode(ord($header[$pos]), ord($header[$pos + 1]));
}
function flvdim_decode($byte1, $byte2) {
$high1 = $byte1 >> 4;
$high2 = $byte2 >> 4;
$low1 = $byte1 & 0x0f;
$mantissa = ($low1 << 4) | $high2;
// (1 + m·2^(-8))·2^(h1 + 1) = (2^8 + m)·2^(h1 - 7)
return ((256 + $mantissa) << $high1) >> 7;
}
Pleaso note that the code is reverse engineered from binary files, but it seems to work reasonably well.