Tiny PHP code to get few attributes from the FLV header
$30-250 USD
Đang triển khai
Đã đăng vào khoảng 14 năm trước
$30-250 USD
Thanh toán khi bàn giao
Your goal is to develop a tiny PHP script,
which will provide function getFLVmetadata()
(not a class, just function).
function getFLVmetadata( $flv_filename [string] )
{
...
...
return array("width"=>$width, "height"=>$height, "duration"=>$duration_seconds);
}
The function will simply read a file given by $flv_filename
and parse its FLV header data, then it will return array,
which consists of the three attributes described above
(video width, video height, duration in seconds)
Your code does NOT need to implement a proper AMF parser,
just get the three attributes and return.
If the given filename is not a valid FLV video,
the function will return an empty array().
You can define any other function you need in order to
parse the metadata efficiently, however, you must prefix
all your other functions with FLV_ prefix.
Do not use classes, just functions.
Do not use any existing code, write everything from scratch.
I expect the result to be a small PHP script (with, say, 200 lines of code max)