I use either handbrake or miro to convert it to a quicktime format (I like .mp4). Then, in photoshop cs5, you can go into File->Import->Import Frames to Layers.
In the Animation bar, trim it up to the length you want. Then File->Save For Web & Devices. Save it as a gif (you can specify up to...