On 7/28/08, Chris Scott <Chris.Scott@xxxxxxxxxx> wrote: > I agree. > > I use MPlayer to process videos. One script gets the video length like this. > > //use mplayer to pull some info from the video > $info = exec("\"$mplayer\" $videoPath/$videoName -identify -nosound -frames 0 > $tmpInfoFile"); > //and open the file it stores the data in > $infoFile = fopen("$tmpInfoFile", "rb"); > //then parse for the video length > while(! feof($infoFile) ) > { > $lineBuffer = fgets($infoFile); > if(preg_match("/ID_LENGTH=/", $lineBuffer)) > { > $videoLength = (int) preg_replace("/ID_LENGTH=/", "", $lineBuffer); > } > } you could probably skip piping it to a tempfile - and just use popen() to open the process... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php