0

.mp4 ファイルのチェックを実行して、php 条件を作成するため、または少なくともコーデックを印刷するための h.264 コーデックがあるかどうかを確認する必要があります。HTMLファイルで実行されるかなり単純なコードはありますか?

4

1 に答える 1

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.'".';
}

ビデオに h.264 エンコーディングがあるかどうかの検出をサポートします。

于 2012-12-16T05:40:17.727 に答える