Exemplo n.º 1
0
}
if (php_sapi_name() != 'cli') {
    echo '<pre>';
}
printf("ffmpeg-php version string: %s\n", FFMPEG_PHP_VERSION_STRING);
printf("ffmpeg-php build date string: %s\n", FFMPEG_PHP_BUILD_DATE_STRING);
printf("libavcodec build number: %d\n", LIBAVCODEC_BUILD_NUMBER);
printf("libavcodec version number: %d\n", LIBAVCODEC_VERSION_NUMBER);
print_class_methods("ffmpeg_movie");
print_class_methods("ffmpeg_frame");
// get an array for movies from the test media directory
$movies = getDirFiles(dirname(__FILE__) . '/tests/test_media');
echo "--------------------\n\n";
foreach ($movies as $movie) {
    $mov = new ffmpeg_movie($movie);
    printf("file name = %s\n", $mov->getFileName());
    printf("duration = %s seconds\n", $mov->getDuration());
    printf("frame count = %s\n", $mov->getFrameCount());
    printf("frame rate = %0.3f fps\n", $mov->getFrameRate());
    printf("comment = %s\n", $mov->getComment());
    printf("title = %s\n", $mov->getTitle());
    printf("author = %s\n", $mov->getAuthor());
    printf("copyright = %s\n", $mov->getCopyright());
    printf("get bit rate = %d\n", $mov->getBitRate());
    printf("has audio = %s\n", $mov->hasAudio() == 0 ? 'No' : 'Yes');
    if ($mov->hasAudio()) {
        printf("get audio stream id= %s\n", $mov->getAudioStreamId());
        printf("get audio codec = %s\n", $mov->getAudioCodec());
        printf("get audio bit rate = %d\n", $mov->getAudioBitRate());
        printf("get audio sample rate = %d \n", $mov->getAudioSampleRate());
        printf("get audio channels = %s\n", $mov->getAudioChannels());
Exemplo n.º 2
0
printf("libavcodec build number: %d<br/>", LIBAVCODEC_BUILD_NUMBER);
printf("libavcodec version number: %d<br/>", LIBAVCODEC_VERSION_NUMBER);
printf("libavcodec build number: %d<br/>", LIBAVCODEC_BUILD_NUMBER);
echo "</td></tr></table>";
echo "<p/>";
print_class_methods("ffmpeg_movie");
echo "<p/>";
print_class_methods("ffmpeg_frame");
// get an array for movies from the test media directory
$movies = getDirFiles(dirname(__FILE__) . '/tests/test_media');
$i = 1;
foreach ($movies as $movie) {
    $mov = new ffmpeg_movie($movie);
    echo '<table width="90%" class="hor-minimalist-a">';
    printf('<caption>Processing Test File: %s...</caption>', basename($mov->getFilename()));
    printf('<thead><tr><th width="150">Method</th><th>Result<br/></th></tr></thead>', $mov->getFileName());
    printf("<tr><td>file name:</td><td>%s<br/></td></tr>", $mov->getFileName());
    printf("<tr><td>duration</td><td>%s seconds<br/></td></tr>", $mov->getDuration());
    printf("<tr><td>frame count</td><td>%s<br/></td></tr>", $mov->getFrameCount());
    printf("<tr><td>frame rate</td><td>%0.3f fps<br/></td></tr>", $mov->getFrameRate());
    printf("<tr><td>comment</td><td>%s<br/></td></tr>", $mov->getComment());
    printf("<tr><td>title</td><td>%s<br/></td></tr>", $mov->getTitle());
    printf("<tr><td>author</td><td>%s<br/></td></tr>", $mov->getAuthor());
    printf("<tr><td>copyright</td><td>%s<br/></td></tr>", $mov->getCopyright());
    printf("<tr><td>get bit rate</td><td>%d<br/></td></tr>", $mov->getBitRate());
    printf("<tr><td>has audio</td><td>%s<br/></td></tr>", $mov->hasAudio() == 0 ? 'No' : 'Yes');
    if ($mov->hasAudio()) {
        printf("<tr><td>get audio stream id</td><td>%s<br/></td></tr>", $mov->getAudioStreamId());
        printf("<tr><td>get audio codec</td><td>%s<br/></td></tr>", $mov->getAudioCodec());
        printf("<tr><td>get audio bit rate</td><td>%d<br/></td></tr>", $mov->getAudioBitRate());
        printf("<tr><td>get audio sample rate</td><td>%d<br/></td></tr>", $mov->getAudioSampleRate());