예제 #1
0
        }
    }
    // 		get the required frame
    $ffmpeg_frame_small = $ffmpeg_movie->getFrame($i);
    if ($ffmpeg_frame_small !== false) {
        // 			crop and resize the frame
        $ffmpeg_frame_small->resize(50, 50, 20, 20, 20, 20);
        // 			then add it to the small one
        $result = $ffmpeg_gif_small->addFrame($ffmpeg_frame_small);
        if (!$result) {
            'There was an error adding frame ' . $i . ' to the gif.<br />';
        }
    }
}
echo '<strong>Animated Gif of Movie</strong>.<br />';
$result = $ffmpeg_gif->saveNow($tmp_dir);
if (!$result) {
    echo 'It was not possible to save the animated gif for some reason.<br />';
} else {
    echo 'This is an animated gif extracted from the movie.<br />';
    echo '<img src="processed/thumbnails/' . $file_info['filename'] . '-animated.gif" alt="" width="' . $orig_width . '" height="' . $orig_height . '" border="0" /><br /><br />';
}
echo '<strong>Cropped and Resized Animated Gif of Movie</strong>.<br />';
$result = $ffmpeg_gif_small->saveNow($tmp_dir);
if (!$result) {
    echo 'It was not possible to save the animated gif for some reason.<br />';
} else {
    echo 'This is an animated gif extracted from the movie but <i>cropped and then resized</i>.<br />';
    echo '<img src="processed/thumbnails/' . $file_info['filename'] . '-animated-small.gif" alt="" width="' . $small_width . '" height="' . $small_height . '" border="0" /><br /><br />';
}
echo '</body></html>';