ffmpeg getFramesResampled test
--SKIPIF--
<?php 
function_exists("imagecreatetruecolor") or die("skip function imagecreatetruecolor unavailable");
require_once '../../ffmpeg_movie.php';
require_once '../../ffmpeg_frame.php';
require_once '../../ffmpeg_animated_gif.php';
$ignore_demo_files = true;
$dir = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
require_once $dir . '/examples/example-config.php';
$tmp_dir = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'tmp/';
?>
--FILE--
<?php 
$mov = new PHPVideoToolkit_movie($dir . '/examples/to-be-processed/cat.mpeg', false, $tmp_dir);
$framecount = $mov->getFrameCount();
for ($i = 1; $i <= $framecount; $i++) {
    $img = sprintf("%s/test-%04d.png", $tmp_dir, $i);
    $width = 40 + ($i % 2 ? $i + 1 : $i);
    $height = 40 + ($i % 2 ? $i + 1 : $i);
    $frame = $mov->getFrame($i);
    $frame->resize($width, $height);
    $gd_image = $frame->toGDImage();
    imagepng($gd_image, $img);
    printf("ffmpeg getFramesResampled(%d): md5 = %s\n", $i, md5(file_get_contents($img)));
    imagedestroy($gd_image);
    unlink($img);
}
?>
--EXPECT--
ffmpeg getFramesResampled(1): md5 = 66c093edcb781f280dcd6e4944be1856
// printf("libavcodec version number: %d\n", LIBAVCODEC_VERSION_NUMBER);
echo "--------------------";
print_class_methods("ffmpeg_movie");
echo "\n\n--------------------";
print_class_methods("ffmpeg_frame");
echo "\n\n--------------------";
print_class_methods("ffmpeg_animated_gif");
echo "\n\n--------------------\n";
// get an array for movies from the test media directory
$movies = getDirFiles($dir . '/examples/to-be-processed');
// print_r($movies);
foreach ($movies as $movie) {
    $mov = new PHPVideoToolkit_movie($movie, false, $tmp_dir);
    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 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()) {
--TEST--
ffmpeg getFrameCount test
--SKIPIF--
<?php 
require_once '../../ffmpeg_movie.php';
require_once '../../ffmpeg_frame.php';
require_once '../../ffmpeg_animated_gif.php';
$ignore_demo_files = true;
$dir = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
require_once $dir . '/examples/example-config.php';
$tmp_dir = PHPVIDEOTOOLKIT_EXAMPLE_ABSOLUTE_BATH . 'tmp/';
?>
--FILE--
<?php 
$mov = new PHPVideoToolkit_movie($dir . '/examples/to-be-processed/cat.mpeg', false, $tmp_dir);
printf("ffmpeg getFrameCount(): %d\n", $mov->getFrameCount());
?>
--EXPECT--
ffmpeg getFrameCount(): 111