Software developed by Collin Burger can automatically locate loops in video to create perfect GIFs - video embedded below:
Loop Findr is a tool that automatically finds loops in videos so you can turn them into seamless gifs.
Since their creation in 1987, animated GIFs have become one of the most popular means of expression on the Internet. They have evolved into their own artistic medium due to their ability to capture a particular feeling and the format’s portable nature. Loop Findr seeks to usher in a new era of seamless GIFs created from loops found in the videos the populate the Internet. Loop Findr is a tool that automatically finds these loops so users can turn them into GIFs that can then be shared all over the Web.
You can find out more background about the project here
There is also a loopfindr Tumblr blog which has examples and links to download the software (Mac only) here