Also how get full file path uri - length in seconds a video media file is like mp4

using something like below how i get length in seconds a video media file is like mp4, ogg or webm?
also how get full file path uri?

$directoryIterator = new RecursiveDirectoryIterator($path);

$recursiveIterator = new RecursiveIteratorIterator($directoryIterator, RecursiveIteratorIterator::SELF_FIRST);
	try {
		foreach ($recursiveIterator as $file) {
echo $file->getBasename();
if ($file->isFile()) {
echo " (" .$file->getSize(). " bytes)<br />";

You would either need to use avconv or a service provider that is able to encode video. It is not a very pleasant and/or easy thing to setup yourself. It will be impossible to setup yourself if you’re not able to compile/install new software on the end server. You will than also need permission to execute shell commands from PHP in order to run files through avconv. The world of video encoding is dark abyss unless you’re very familiar with the standard technology stacks involved. If your asking this type of question it leads me to believe you would be better of with a service provider. Though I’m not sure if that would be worth it for just detecting the duration of a video.