Video Thumbnail (remote file)
Posted: 2011-03-27T06:34:03-07:00
I have a system set up whereby my users upload files from their local machines directly to an Amazon AWS S3 repository, meaning that I do not have "local" access on my server of the "original" files to creat thumbnails from. I have been able to create a workaround for making thumbnails of images using the following method:
This works very well (minus the extensions i haven't gotten working yet) for still images. The issue is that I also have videos on that server that I need thumbnails of. I am looking for a method to create those thumbnails in the same way. The videos range in size from very small to upwards of 300MB each, so It would be crazy to download each video just to create a thumbnail, hence my search for a hook or method that works.
Any tips would be greatly appreciated.
Thank you,
Silver Tiger
Code: Select all
$S3_file_name = "https://s3.amazonaws.com/bucket/filename.jpg";
$handle = fopen($S3_file_name, 'rb');
$img = new Imagick();
$img->readImageFile($handle);
$img->thumbnailImage( 100, null );
//$img->roundCorners( 5, 5 ); // Not working yet, I may have something installed wrong
//$shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) ); // Not working yet, I may have something installed wrong
//$shadow->shadowImage( 80, 3, 5, 5 ); // Not working yet, I may have something installed wrong
//$shadow->compositeImage( $img, Imagick::COMPOSITE_OVER, 0, 0 ); // Not working yet, I may have something installed wrong
$img->writeImage('temp_thumbnails/thumbnail.jpg";
Any tips would be greatly appreciated.
Thank you,
Silver Tiger