Created
December 2, 2015 21:26
-
-
Save cryptixcoder/9a2c3c1f453d5011654e to your computer and use it in GitHub Desktop.
duration of a video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ffmpeg_output = shell_exec("ffmpeg -i \"$file\" 2>&1"); | |
if( preg_match('/.*Duration: ([0-9:]+).*/', $ffmpeg_output, $matches) ) { | |
echo $matches[1]; | |
} else { | |
echo "$file failed\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment