Changing Movie Thumbnails (Low-Tech, NOT ffmpeg)

This all works for me with ver 1.4.2 RC-2, and I haven't tested it on any other versions. See it in action on my site at http://webhollis.com . I don't use ffmpeg and thought some folks might want to do it by hand like I do. It probably ends up being more time-consuming in the long run, but here you go if you want to know:

1. CHANGING YOUR DEFAULT MOVIE THUMBNAIL: First off, when you load a video into Gallery, it will automatically be given the thumbnail located in your "images/" directory called "movie.thumb.jpg".

If you want to create thumbnails of different dimensions than that file has (default 100 pixels by 84 pixels) all you need to do is create a *.jpg image with the same name, and load it into that directory, replacing "images/movie.thumb.jpg".

This will trick Gallery into using whatever image you have replaced it with as the default thumbnail for loaded movies, and will use your new thumbnail's dimensions as well. I find that a "150 x 115" image works well for most video captures.

You can go back and change this image any time you want to, and any videos you load after uploading it will use it as their thumbnail. All of the videos on your site that already have thumbnails will not be set to this new image- they will keep what they already had.

IMPORTANT NOTE: IF YOU "REBUILD YOUR THUMBNAILS" IN AN ALBUM OR MOVE YOUR MOVIE FILES TO ANOTHER ALBUM, THEIR THUMBNAIL IMAGE WILL BE RESET TO WHATEVER YOU CURRENTLY HAVE AS THE "IMAGES/MOVIE.THUMB.JPG" FILE, AND THE ONES YOU HAD WILL BE LOST! So watch out- I've messed it up before and it can be kind of annoying.

2. MAKING UNIQUE THUMBNAILS FOR EACH VIDEO FILE: Now that you have replaced your default thumbnail with a good all-around video thumb, you can go about creating individual thumbnails for each movie that you have. To do this, you will need to do a screen capture, and have a photo-editing tool to edit the image to your liking.

2A. Getting a "screen capture" isn't hard at all. The only OS I work on is Windows systems so that's all I can comment on, but it's a very easy procedure. Here's all you have to do:

1) Open up your video file with its associated program (like Windows Media Player, Quicktime, or Real Player). 2) Play the video clip up to the desired frame (not in full mode), and once it reaches it, pause the film (you don't HAVE to pause it, I'd just recommend it). 3) Once to that point, just press the "ALT" and "Print Screen" buttons at the same time. At this point, Windows will have just stored an image of the program you were viewing your clip with, ready to be used in the photo editing program of your choice. 4) Open up a new image in your photo editor (Windows Paint works just fine) and paste in what you just captured (press the "Ctrl" and "V" keys at the same time). You should now have an image from the video you were watching. 4a. What? It didn't work? It just showed a blank Windows Media Player Window or similar? Not a problem. To fix this in WMP, open up the program and go to "Tools" then "Options". You should see a tab in that section labeled "Performance". Go to it and find the Video Acceleration section. It should be a snap-to marker. Just set it all the way to the left (none), and that'll fix it for you. Now click "Apply", close it out, and try it again. 4b. Didn't work in Real Player? Open it up and go to "View" then "Preferences" and click on the "Performance" tab. At the bottom, there should be a "Video Card Compatibility" section with a clickable box to "Use Optimized Video Display". Uncheck it, click apply, close it out, and give it a whirl again. It should now work.

2B. Once you have the file saved as a bitmap (*.bmp) or jpeg or whatever, you'll need to crop the image to the right size so that when you scale it down it fits in the default thumbnails spot correctly. Essentially, you will just be replacing the default thumbnail with the one you are making, so they will need to have the same (or at least VERY CLOSE to the same) pixel measurements. This is probably the most time-consuming part of the whole process at first, but once you start doing it as many times as I have, you get a pretty good eye for dimensions.

2C. After cropping the image, resize it to 150 x 115 or whatever size your default thumbnail is, and save your image in jpg format.

2D. Now, go into your albums directory on your site, and find the album that contains the thumbnail you want to change. Find that file's thumbnail (your_image_name.thumb.jpg) and copy its name from the album. Now make that name the exact same name of your image, and upload it to that directory. Now when Gallery goes looking for this image as a thumbnail, your custom image will appear instead. That's it for the thumbnail! Enjoy!

3. GIVING VIDEOS AN INDIVIDUAL PAGE The version of Gallery I'm running doesn't give each video its own page, so people can't comment or vote on videos, which I wanted them to have the option of doing. For me, I changed the following to get it to work:

BACK UP YOUR FILE BEFORE YOU TRY THIS!

In the root directory, open up view_albums.php and find (line 724 for me):

Code:

   if ($gallery->album->isMovie($id)) {
           $gallery->html_wrap['imageTag'] = $gallery->album->getThumbnailTag($i);
           $gallery->html_wrap['imageHref'] = $gallery->album->getPhotoPath($i);

Change that third line so that it reads:

Code:

   $gallery->html_wrap['imageHref'] = makeAlbumUrl($gallery->session->albumName, $id);

That's it. Go make sure it works.

4. ADD MORE MOVIE/OTHER FILE TYPE SUPPORT:

BACK UP YOUR FILE BEFORE YOU DO THIS!

Open up the file util.php in your main Gallery directory, and find the line (line 295 for me) that says:

Code:

   function acceptableMovieList() {
      return array('avi', 'mpg', 'mpeg', 'wmv', 'mov', 'swf', 'mp4');
   }

Change it to read:

Code:

   function acceptableMovieList() {
      return array('avi', 'asf', 'mpg', 'mpeg', 'wmv', 'mov', 'swf', 'mp4', 'rm', 'ram', 'exe', 'zip', 'mp3', 'wav', 'mid', 'doc');

}

You can add any more file extensions that you would like to support on your site. Just use the same format '.*', for each of them.

NOTE: Adding these file extensions in only lets the Gallery program SEE this type of file- it does not mean that your site will show the file type on your pages. To play/view each of these file types, individuals viewing your site still need whatever program is associated with that file type (ie Quicktime, Real Player, etc).

Alright, well that's all from me. Enjoy~ Hollis Hudetz