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()); } printf("has video = %s\n", $mov->hasVideo() == 0 ? 'No' : 'Yes'); if ($mov->hasVideo()) { printf("frame height = %d pixels\n", $mov->getFrameHeight()); printf("frame width = %d pixels\n", $mov->getFrameWidth()); printf("get video stream id= %s\n", $mov->getVideoStreamId()); printf("get video codec = %s\n", $mov->getVideoCodec()); printf("get video bit rate = %d\n", $mov->getVideoBitRate()); printf("get pixel format = %s\n", $mov->getPixelFormat()); printf("get pixel aspect ratio = %s\n", $mov->getPixelAspectRatio()); $frame = $mov->getFrame(10); printf("get frame = %s\n", is_object($frame) ? 'true' : 'false'); printf(" get frame number = %d\n", $mov->getFrameNumber()); printf(" get frame width = %d\n", $frame->getWidth()); printf(" get frame height = %d\n", $frame->getHeight()); } echo "\n--------------------\n\n"; } if (php_sapi_name() != 'cli') { echo '</pre>'; } /* FUNCTIONS */ function print_class_methods($class) {
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()); printf("<tr><td>get audio channels</td><td>%s<br/></td></tr>", $mov->getAudioChannels()); } printf("<tr><td>has video</td><td>%s<br/></td></tr>", $mov->hasVideo() == 0 ? 'No' : 'Yes'); if ($mov->hasVideo()) { printf("<tr><td>frame height</td><td>%d pixels<br/></td></tr>", $mov->getFrameHeight()); printf("<tr><td>frame width</td><td>%d pixels<br/></td></tr>", $mov->getFrameWidth()); printf("<tr><td>get video stream id</td><td>%s<br/></td></tr>", $mov->getVideoStreamId()); printf("<tr><td>get video codec</td><td>%s<br/></td></tr>", $mov->getVideoCodec()); printf("<tr><td>get video bit rate</td><td>%d<br/></td></tr>", $mov->getVideoBitRate()); printf("<tr><td>get pixel format</td><td>%s<br/></td></tr>", $mov->getPixelFormat()); printf("<tr><td>get pixel aspect ratio</td><td>%s<br/></td></tr>", $mov->getPixelAspectRatio()); printf("<tr><td>get frame</td><td>%s<br/></td></tr>", is_object($mov->getFrame(10)) ? 'true' : 'false'); printf("<tr><td>get frame number</td><td>%d<br/></td></tr>", $mov->getFrameNumber()); $thumbpath = "{$i}.png"; if (make_test_thumbnail(rand(1, 100), $mov->getFilename(), $thumbpath)) { printf('<tr><td>Random Thumbnail</td><td><img alt="Test Image" src="%s"/></td></tr>', $thumbpath); } } echo "</table>"; echo "<p/><p/>"; $i++; } echo '</div></body></html>'; if (php_sapi_name() == 'cli') { $content = ob_get_clean();