Example #1
3
            </div>
            <div id="gbox-bg">

            
              <div id="gbox-grd">
                
                <div id="newsletter">
                <div id="videoInfo">
                <?php 
if (isset($_REQUEST['BttnAtach'])) {
    $start = microtime(true);
    if ($parseUrl['host'] == "www.vimeo.com" || $parseUrl['host'] == "vimeo.com") {
        //print_r(MP4Info::getInfo($url));
        $mp4 = new MP4Info();
        $metadata_mp4 = array();
        $metadata_mp4 = MP4Info::getInfo($url);
        $context = new stdClass();
        $context = $metadata_mp4;
        //print_r($context);
        $metadata["width"] = $context->video->width;
        $metadata["height"] = $context->video->height;
        $metadata["duration"] = $context->duration;
        //$metadata["audiodelay"] = $context->audio->codecStr;
        $metadata["audiocodecid"] = $context->audio->codec;
        $metadata["audiocodecStr"] = $context->audio->codecStr;
        $metadata["videocodecid"] = $context->video->codec;
        $metadata["videocodecStr"] = $context->video->codecStr;
        //stdClass Object ( [hasVideo] => 1 [hasAudio] => 1 [video] => stdClass Object ( [width] => 640 [height] => 360 [codec] => 224 [codecStr] => H.264 ) [audio] => stdClass Object ( [codec] => 224 [codecStr] => AAC ) [duration] => 201.316666667 )
    } else {
        $flv = new FLVMetaData($url);
        //FLVMetaData("0002.flv");
Example #2
2
 */
// ---
include "MP4Info.php";
print '<h1>MP4Info test script</h1>';
print '<p><small>' . __FILE__ . ' $Id: test.php 2 2009-06-11 14:12:31Z lacroix.tommy@gmail.com $</small></p>';
print '<hr />';
$dir = './TestFiles/';
$de = opendir($dir);
if ($de) {
    while (($file = readdir($de)) !== false) {
        $path = $dir . $file;
        if (!is_file($path) || !is_readable($path) || strtolower(pathinfo($path, PATHINFO_EXTENSION) != 'f4v')) {
            continue;
        }
        print '<h2>' . $file . '</h2>';
        print "<pre>";
        try {
            print_r(MP4Info::getInfo($path));
        } catch (MP4Info_Exception $e) {
            print 'Caught MP4Info_Exception with message ' . $e->getMessage();
            throw $e;
        } catch (Exception $e) {
            print 'Cauth Exception with message ' . $e->getMessage();
            throw $e;
        }
        print "</pre>";
        print '<hr/>';
    }
} else {
    print '<strong>Could not open directory "' . $dir . '".';
}