The GIMP Animation Package will let you do it. Take an AVI video, specify the beginning and end times of the frames you want (I usually just trim the video in windows movie maker first). Then export each frame as a xcf file. Open them all as layers then set the color mode to indexed and export it as an animated gif.