Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I obtain the dimensions of a Flash video file from PHP code?

Tags:

php

flash

I have an application where users can upload video files of any size, and I'd like to be able to determine the the height/width of a Flash video file (flv or f4v) from a PHP script so that I can size the player appropriately. I'd love a pure PHP solution, but I'd be open to shelling out to a command line tool and parsing the output (if such a tool exists).

Thanks in advance!

like image 458
Jim OHalloran Avatar asked Nov 27 '25 22:11

Jim OHalloran


1 Answers

ffmpeg is probably your best bet, there is even a php module of it.

ffmpeg -i "FileName"

Alternativly you could read the information from the flv file directly by opening the file and reading the meta information.

like image 192
Ady Avatar answered Nov 30 '25 10:11

Ady



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!